Sign in to follow this  

Suggestion for a newbie

Recommended Posts

washburn_it    122
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: 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
lc_overlord    436
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

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