How to rotate a texture?

edited November 2013 in How To...

Hi, Is it possible to have textures that are not perpendicular to a surface? That is, can I have an origin, rotation and scaling for a texture that gets projected across an object?

I want to have a still cube, and rotate the texture for that cube.



  • Answer ✓

    are you using vertex(x, y, z, u, v)? then just change the u and v parameters.

    you'll have to do the scaling and rotation calculations for these yourself, unfortunately.

  • Ok, thanks for the tip. I was thinking from the point of view of 3D animation software where you can often map a rectangular (or cylindrical / spherical) texture onto any object.

    As a pointer for others who might want to do this, we could calculate u and v based on x, y, z. One simple way of doing that would be to map x to u (scaled to 0..1), y to v (scaled to 0..1) and ignore z.

    To rotate the texture, as I want to do, one would need some trigonometry to project the object vertices into an imaginary flat surface (the rotating texture).


Sign In or Register to comment.