Jump to content
  • Advertisement
Sign in to follow this  
jimbogd

OpenGL advice for rotating viewport 90/180/270 degrees please

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

I'm writing a frontend for a cocktail cabinet arcade game system that lists games along with their screenshots so users can pick a game and play it. The cocktail cabinet could be 4-players (one player each side of the table/screen), so I need to rotate the list of games on the fly so each person can pick games from the list. My opengl rendering routine currently draws 2D textured quads for the game list and screenshots (and any other gfx), and so far I only have a single view for player 1 (non rotated). I can think of 2 ways of rotating the view to 90/180/270 degrees (for each player): - 1) I adjust the sizes/positions of the quads as I draw them, and map the correct (rotated) "corners" of the textures to them. This way I don't have to glRotate() the scene. 2) I draw the scene quads normally (stretching/scaling to fit the rotated resolution where necessary) and then call glRotate() once about the Z access. So my questions are: Which one of the above ways would be best/fastest? Am I on the right lines here, or is there another (better) way of doing this that I'm missing? Many thanks for any advice, jimbogd

Share this post


Link to post
Share on other sites
Advertisement
Hi!

I would use the first method. You can precompute the coordinates so you don't have to calculate them on the fly each time. Since you only want 4 different rotations, you can store all the rotations beforehand in a struct or similar. It would be faster than the other method, since you don't need an extra matrix multiplication and creation of a rotation matrix.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!