🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Suggestion for a newbie

Started by
0 comments, last by lc_overlord 18 years, 3 months ago
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
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.

This topic is closed to new replies.

Advertisement