# Thread: Trigonometry assistance: defining a simple waveform

1. ## 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!

++++++++++++
(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....

3. ## 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:

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.

4. Originally Posted by jeric_synergy
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.

5. Will do!
+++++++++

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

... 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)

6. To have y=sin(x)
you need something like this:

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..

7. Originally Posted by Sensei
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.

8. 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.

9. 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.

10. 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.

11. 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.

12. 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.

13. .... 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.....

14. Originally Posted by jeric_synergy
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.

15. Actually, I can expect the UI to help me learn. And good labeling would assist that. Sorry man, but nope.