Jump to content
  • Advertisement
Sign in to follow this  
Raeldor

Radar How-To?

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

Hi All, I am working on my UI module for my game engine, and got to thinking about the radar which seems to be a common game UI element. It seems to me that assuming you want the rotating kind of radar that two textures would be necessary for the UI element. The first texture would be the radar 'frame' with it's corresponding alpha channel so you can make the shape round if desired. The second texture would be a display mask which would be filled to represent the area INSIDE The radar. This would be used in the same texture pass as your map and would override the map alpha-channel values. I assume the rotating of the map could be done using a texture transform matrix on the stage that is picking up the RGB values from the map texture? Am I on the right track here? Is there a simpler way of doing this that I am unaware of? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
its so simple as

glMatrixMode(GL_TEXTURE_MATRIX);
glPushMatrix();
glRotate(Angle,0,0,1);
//......... RENDER THE QUAD
glPopMatrix();
glMatrixMode(GL_MODELVIEW);

I would not recommend rotating the quad especially as you will be dealing with a GUI and when u rotate the quad its corners will move and may have undesired results. But it may how ever be faster!

Share this post


Link to post
Share on other sites
Quote:
Original post by dawidjoubert
its so simple as

glMatrixMode(GL_TEXTURE_MATRIX);
glPushMatrix();
glRotate(Angle,0,0,1);
//......... RENDER THE QUAD
glPopMatrix();
glMatrixMode(GL_MODELVIEW);

I would not recommend rotating the quad especially as you will be dealing with a GUI and when u rotate the quad its corners will move and may have undesired results. But it may how ever be faster!


Cool, I have it working now, thank you. I think my problem was that I was trying to do the translation using _41 and _42 instead of _31 and _32 since it is a 2 dimensional transformation.

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!