Trig Vop

   2384   5   0
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi All,
My trig maths is awful ! to the point I cannot seem to replicate what I can do in SOPs . I have built a vop sop and try to replicate in the scene what an attribute SOP is doing. In this case a simple sin wave with a frequency and amplitude < no sure in VOP sops why I could get inverted values. Any ideas


Rob

Attachments:
sinwavevalue.hip (87.8 KB)

Gone fishing
User Avatar
Member
8579 posts
Joined: July 2007
Offline
that's because sin() expression takes degrees and Trig VOP radians
so just append Degrees To Radians VOP after Frame
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
the expression takes degrees, the vop radians, at least it looks like
edit: too slow,
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi Tomas,
Thanks for the tip, thats one for the note book without doubt. Part 2 of my question because it interests me and Im sure others, sin() is values between -1 and 1 . So if I have values that currently go from -2 to 2 is there a way to move the range to positive numbers without the clamping. I thought fit(sin($FF*12)*2,-2,2,0,4) would do that job. Its been so long since messing with numbers I have done a quick refresher and got something working

Always helps to visually drive something with values ! . fixed scene attached for others to look at


Rob

Attachments:
sinwavevalue.hip (102.5 KB)

Gone fishing
User Avatar
Member
8579 posts
Joined: July 2007
Offline
that's correct fit(sin($FF*12)*2,-2,2,0,4) will rescale -2..2 range to 0..4
and since sin()*2 has limits at -2,2, it will not be clamped

but in that case multiplying sin() by 2 is redundand
so you can just use

fit11(sin($FF*12),0,4)

fit11() will assume source range is -1..1, which for sin() is correct
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi Tomas,
Gold answer

Rob
Gone fishing
  • Quick Links