how to rotate a texture?

Posted By: Anonymous

how to rotate a texture? - 10/11/11 18:45

how can i rotate a texture - like shifting with mtl_uvspeed?
Posted By: lostclimate

Re: how to rotate a texture? - 10/11/11 20:01

it will require some trig, i wont explain it in full because its a little compilicated but you'd want to look up using sin and cos functions if you look it up (soh cah toa) on google you should be able to find the proper info to figure it out. laugh
Posted By: Joey

Re: how to rotate a texture? - 10/11/11 20:05

Code:
x' = cos(a)*x - sin(a)*y
y' = sin(a)*x + cos(a)*y


then use that as lookup. You can also create a rotation matrix offline, pass it to your shader and use mul(...), that should be way faster.
© 2024 lite-C Forums