Jump to content
  • Advertisement
Sign in to follow this  
washburn_it

Suggestion for a newbie

This topic is 4498 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, I'm developing an application for the flight simulation world, we call it "glass cockpit". It is mainly the reproduction of flight instruments such as engine RPM, engine temperature, gyro compass and so on. I developed with success, using OpenGL and some tutorials found on this site, a complete panel with 8 instruments that show some engine parameters of a turboprop aircraft (with Flight Simulator 2004). Now my problem is to build the so called "attitude indicator" shown at the following link: http://img229.imageshack.us/img229/76/pfd6fb.png. The blue and the brown area scroll up and down according with the "aircraft's nose" and can inclinate left or right according with the "wing's inclination". How can I make the scrolling up and down? I have no problem with the rotation left-right, so for the scrolling I'm thinking on using a bitmap mapped as a texture 512x512 and a glScissor to define a region where that texture will scroll up and down (making visible only the part of the scale that interests) but I'm not sure that with glScissor I can define a non-rectangular region (as you can see from the picture the area blue-brown is not rectangular at top and bottom). Is there then a more efficient way to do that scrolling? Thank you, regards. Bob

Share this post


Link to post
Share on other sites
Advertisement
You got 3 options.

1. use glScissor to clip out the area around the attitude indicator window.
then use either a texture with an alpha texture to cover that or a couple polygons in the correct shape.

2. use the stencil buffer to cut out a nonrectangular hole for the indicator window to be renderd trough.

3. make the attitude indicator window into a polygon and then manipulate the uv coordinates.

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!