Sign in to follow this  
Raeldor

Radar How-To?

Recommended Posts

Raeldor    254
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
dawidjoubert    161
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
Raeldor    254
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

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