• Create Account

# kbenderoth89

Member Since 28 May 2012
Offline Last Active Jun 12 2012 05:10 PM

### color stripes based on time

03 June 2012 - 12:17 PM

In a class I am taking, we had to create an object, make it rotate and scale (done) and have rainbow stripes moving upwards towards the Y direction as it is scaling and rotating. I was unable to get the last part done. Still passed though , but I don't believe in "good enough" so even though it's aready graded, I want to finish it and make sure that I am able to do it again if I ever need to.

So I'm using FX Composer, and I set up the pixer shader to return the world location, which I know changes the color based on the location. But what I WANT to happen is create a stripe pattern full of colors of the rainbow, and they'll be moving upwards as time goes by. All I know is that it'll involve sine, cosine, and tangent. But I have absolutely no clue how that would work or why. I haven't done trig or calc related stuff in years so if someone could also explain how manipulating the sin,cos,and tan waves works also that would be awesome.

### 3D scaling using sine based on time

03 June 2012 - 02:39 AM

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?

PARTNERS