Jump to content
  • Advertisement
Sign in to follow this  
Daft_ Panzer

Rotating textures relative to objects?

This topic is 4084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
@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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!