PDA

View Full Version : Trigonometry assistance: defining a simple waveform



jeric_synergy
09-06-2016, 05:15 PM
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. :confused:

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

Thanks!

jeric_synergy
09-06-2016, 05:24 PM
#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....

jeric_synergy
09-06-2016, 07:17 PM
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:
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.

RebelHill
09-08-2016, 06:25 AM
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.

jeric_synergy
09-08-2016, 08:05 AM
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...
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)

Sensei
09-08-2016, 08:38 AM
To have y=sin(x)
you need something like this:

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

jeric_synergy
09-08-2016, 10:42 AM
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.

Sensei
09-08-2016, 10:47 AM
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.

RebelHill
09-08-2016, 10:54 AM
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.

jeric_synergy
09-08-2016, 10:59 AM
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.

RebelHill
09-08-2016, 11:13 AM
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.

jeric_synergy
09-08-2016, 04:24 PM
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.

jeric_synergy
09-08-2016, 04:52 PM
.... it's so soothing..... mesmerizing.....


134397

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

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

RebelHill
09-08-2016, 05:26 PM
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.

jeric_synergy
09-09-2016, 01:14 AM
Actually, I can expect the UI to help me learn. And good labeling would assist that. Sorry man, but nope.

jeric_synergy
09-09-2016, 01:37 AM
This seems to do what I want!
134400

Maybe I'll make some nulls to control the rate variables, but this works for now.

Now, to sculpt the sun-face. I'm thinking of emulating the automaton artist Jan Zalud.

++++++++++++++++++++
134401