Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Trigonometry assistance: defining a simple waveform

  1. #1
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732

    Question Trigonometry assistance: defining a simple waveform

    Need some basic trigonometry assistance:

    I want to define a waveform that is essentially a cosine/sine wave, but that has two changes as it proceeds along the X axis:

    #1) (easy) I want the amplitude to start (at X=0) small, and gradually increase over time, and
    #2) (harder) I want the frequency to increase the further from X the function gets.

    Once upon a time this would have been trivial, but I've lost that knowledge over the years.

    Oh, and I want to do this with nodes, which I figure will make it even simpler.

    Thanks!
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  2. #2
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    #1 is : y=(cos(x))*((x+1)/ADJUSTER)

    ++++++++++++
    (later)

    OK, #2 is going to be something like

    y=cos(X+(X/SCALEVALUE))


    Now, to combine the two, and realize it in nodal form. FWIW, this is for a displacement thingy....
    Last edited by jeric_synergy; 09-06-2016 at 06:00 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  3. #3
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732

    Question Nodal displacement: looping thru all the points

    Okay, just talking to myself,

    Now that I have a clue on the actual math involved, wanted to test with a simple box strip. Here's the simple starting version of the displacement network:
    Click image for larger version. 

Name:	cos.jpg 
Views:	60 
Size:	255.6 KB 
ID:	134364
    I thought that this sort of network would evaluate every point in a mesh and apply the network's output to every point. Instead, while the object as a whole is displaced (or every point is displaced equally, probably) the points don't seem to be evaluated separately.

    This has been a conceptual barrier for me before, so I'm sure I've wired it up wrong. How to get each point evaluated and transformed?

    Thanks.

    (PS: there's some unconnected nodes in the image, just ignore them, WIP.
    Last edited by jeric_synergy; 09-06-2016 at 08:09 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  4. #4
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,771
    Quote Originally Posted by jeric_synergy View Post
    I thought that this sort of network would evaluate every point in a mesh and apply the network's output to every point. Instead, while the object as a whole is displaced (or every point is displaced equally, probably) the points don't seem to be evaluated separately.
    Ofc... you're using the DP point info node, which gives info on 1 specific point only... use the input node.
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  5. #5
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    Will do!
    +++++++++

    Perfect! THANKS, RH! Now to learn how to alter the phase of the waveform.

    I'm not even going to feel guilty about this because, IMStronglyHeldO...
    Click image for larger version. 

Name:	cos.jpg 
Views:	54 
Size:	121.0 KB 
ID:	134391
    ... the input node of the Displacement node editor should read "POINT Position" and "POINT World Position".

    While the "Object" in this context may be a point, "Object" has a special meaning in Lightwave, and this confuses the issue.

    ++++
    So, how does one alter the phase of the waveform? Is it as simple as merely ADDING to the evaluated value, the X in cos(x)? (ANS=Yes)
    Last edited by jeric_synergy; 09-08-2016 at 09:05 AM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  6. #6
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,900
    To have y=sin(x)
    you need something like this:

    Click image for larger version. 

Name:	1.png 
Views:	63 
Size:	416.4 KB 
ID:	134392

    Constant > Vector is center 0,0,0 (you could use Item Info > World Position instead)
    I added Time to have animation.

    If you will multiply output from sin (or cos), by some value depending on distance from center,
    1.0....0.0 (use gradient with Distance output as input)
    amplitude will fade away to nothing at some point from center.
    If you will multiply input to sin (or cos), by some value depending on distance, frequency will be changed.

    I don't know why you used Point Info..
    Last edited by Sensei; 09-08-2016 at 08:40 AM.

  7. #7
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    Quote Originally Posted by Sensei View Post
    I don't know why you used Point Info..
    The usual: incompetence.

    What I am trying to accomplish is to give a stylized sun object, think "wall decoration", with waving 'rays': near the sun they need to be locked, and further away they need to be bigger and faster. I figure: do ONE and instance it around the body.

    And as I stated above the labeling of the Input Node is not helpful to occasional users: with the word "Object" being used, it's less clear than it could be that the subject at hand is POINTS, not Objects per se.

    This fix doesn't even take any coding, only re-labeling.

    My read on the node was that "Object Position" referred to the OBJECT.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  8. #8
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,900
    Object Position means coordinate of point in Object Space,
    while
    World Position means coordinate of point in World Space.
    Difference between them is transformation from local object coord-space to world coord-space.
    To not have to bother user doing this with vector-matrix multiplication.
    They're named correctly.
    Last edited by Sensei; 09-08-2016 at 10:49 AM.

  9. #9
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,771
    Yeah... you're displacing an object... so the position of the object itself is irrelevant as you're performing a transform "within" that object... object and world are obviously object and world space.
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  10. #10
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    To the occasional user, these are fine details. No bad thing would occur if "Point" were in the Input node label, as it is true, and it would serve to remind the user that they are not dealing with (LW) Objects, they are dealing with the points within the Object.

    Users already have enough trouble using nodes that a bit of assistance isn't warranted.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  11. #11
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,771
    Displacements are ALWAYS dealing with the vertices of an object. If this confuses the casual user, then their knowledge of the basics is too casual to begin with.
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  12. #12
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    The UI should help the user, not make their work contingent on being vigilant.

    To do otherwise is to leave scalpels in the pencil cup.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  13. #13
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732

    Cool

    .... it's so soothing..... mesmerizing.....


    Cosine.zip

    ++++++++++++

    Getting there: need to implement controls for the RATE of increase in FREQUENCE and AMPLITUDE. Giving the ol' sixth grade math a workout.....
    Click image for larger version. 

Name:	cos2.jpg 
Views:	51 
Size:	256.6 KB 
ID:	134399
    Last edited by jeric_synergy; 09-08-2016 at 06:14 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  14. #14
    Goes bump in the night RebelHill's Avatar
    Join Date
    Nov 2003
    Location
    jersey
    Posts
    5,771
    Quote Originally Posted by jeric_synergy View Post
    The UI should help the user, not make their work contingent on being vigilant.
    Sorry, man, but nope. Its got nothing to do with vigilance... simply knowing the basics of what you're doing. Cant expect the UI to solve ignorance.
    LSR Surface and Rendering Tuts.
    RHiggit Rigging and Animation Tools
    RHA Animation Tutorials
    RHR Rigging Tutorials
    RHN Nodal Tutorials
    YT Vids Tuts for all

  15. #15
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    Actually, I can expect the UI to help me learn. And good labeling would assist that. Sorry man, but nope.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •