Sign in to follow this  
Daft_ Panzer

Rotating textures relative to objects?

Recommended Posts

Daft_ Panzer    144
Yet another question :) Just wondering if anyone happens to know about rotating texture coords on their own... I have glCopyTexImage2D working quite well, and I can use it for various effects, like ‘cloaked ships’, which are basically invisible except for a little distortion. However, id like to be able to rotate these cloaked sprites (quads), without rotating the texture too. IE, the texture coords need to remain relative to the screen (to get the slightly-distorted background effect), while only the object itself is rotated. Otherwise, the distorted background section is at a different angle to the rest of the background, which is hardly stealthy :) So, either the quad vertices or the texture vertices needs to be rotated independent of the other. I’ve been searching online for a long while, I can find basically nothing about this. A few mentions of it being done, but no examples. I know it must be possible, but I guess the trigonometry could be a bit complicated. Thanks yet again for any help :)

Share this post


Link to post
Share on other sites
jon723    168
What I usually do is enable automatic texture coordinate generation and then set the texture mode to "EYE_LINEAR". This way texture coordinates and object transformations are independent.

Share this post


Link to post
Share on other sites
Daft_ Panzer    144
@Exorcist, thanks but projective texturing seems to be a bit too complicated for me :(

@Jon723, thanks for pointing out texture modes. Thats something i've never played about with, and dont know much about. Im looking up EYE_LINEAR mode now :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this