Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Rotating a texture to always face the camera

This topic is 5899 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

Can anyone offer me any tips on how to do this? I can make it so it faces the camera horizontally... but once I get into the rotation around the x axis It doesn''t work. I have the vector of the camera position and a vector of the texture center position.... THANKS!

Share this post

Link to post
Share on other sites
well, you can''t "rotate a texture to face the camera" you probably mean rotating the quad to which the texture is bound ie. billboarding, don''t you?

The easiest (and very fast to implement of you already work with matrices) solution is to transform the center of the billboard into eye space, extend it to a quad and transform the quad back to object space.

There are plenty of tutorials about billboards around the net


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!