So I'm trying to make my teapot scale properly when testing my HLSL shader effect.
currently I have this:
float4x4 scale = {(sin(gTime)*sin(gTime)),0,0,0,
0,sin(gTime)*sin(gTime),0,0,
0,0,sin(gTime)*sin(gTime),0,
0,0,0,1};
where gTime is the time elapsed since the program started.
Basically what I want it to do is scale from about 0.5 of its original state to 1.0 (the original size) constantly.
you could probably guess that what I currently have scales it from 1.0 to 0.0
is also tried using the absolute value and, well, it partially works, only the full scaling takes about 4 seconds and it takes 3 seconds before it moves
can anyone help me scale it smoothly from half its size to its full size using sin, cos, or tan?
3D scaling using sine based on time
Started by kbenderoth89, Jun 03 2012 02:39 AM
3 replies to this topic
Sponsor:
#3 Crossbones+ - Reputation: 910
Posted 03 June 2012 - 06:22 AM
Keep in mind that squaring the sine function also doubles its frequency, and there is no need to actually square the sine because you can rescale and shift the unmodified sine function using (3 + sin(t)) / 4 to get a range of values between 0.5 and 1.0.
-Josh
-Josh






