Advertisement

Drawing all those indicators inside the cockpit

Started by December 18, 2001 09:04 AM
1 comment, last by lowlevel 23 years, 2 months ago
Heh, first I'd like to say that I hope you guys will understand my problem, since I lack many of the english words for what I will try to explain Anyway, here is my problem. I'm am doing a simple 3D presentation of a simulation of a flying aircraft seen from inside the cockpit. In this visualisation I have a flat grid representing the ground and a "bunch of indicators" like heightindicator, headingindicator and an angleindicator. The angleindicator should show the angle of the aircraft compared to the ground. This is done by having the lines follow the ground and drawing text by them saying 5, 10 and so on. This is my problem. I have drawn the ground using gluPerspective and when I'm drawing the indicators I change to an orthographic projection. How do I calculate where the ground is in my orthograpic projection? Edit: Spelling misstakes. Edited by - lowlevel on December 18, 2001 10:05:46 AM
I think you''re thinking of things incorrectly. Don''t worry about the ground, worry about the plane -- that''s what the indicators should do. From your description of your "angle indicator" it sounds like you''re trying implement a heads-up-display (HUD) with a graphic overlay ontop of your "real" terrain below.

Figure that such an overlay is really just a long strip of clear film with numbers and lines on it. When you aim the plane down, the strip slides up. When you aim the plane up, the strip slides down. I''m assuming you''ve got some means of aiming the plane, which means you''ll likely have an angle that tells you the pitch angle (x-rotation, very likely). Using this number, you should be able to figure out the rate that this strip of numbers and lines needs to slide.

You''ll need to take into consideration your field of view angle. Since this is the first parameter to gluPerspective, you obviously have this information at hand. This number will tell you how many lines should be visible on the screen. If your view angle is 60 degrees, you should have -30.0 on the bottom of the screen and 30.0 at the top, if your pitch is 0 degrees. If you pitch up by 30 degrees, you should translate your strip by sufficient units to place 30 at the center, 60 at the top, and 0 at the bottom.

Hope this made sense.
Advertisement
Thanks for the reply, and sorry for not answering sooner. Ah, a HUD, thats the word I was lookong for

I get all the info I need from a simulation model(roll, pitch, heading, height above sealevel and so on). I'm doing this for work, and people here know alot about airplanes, but noone knows OpenGl better then me and I'm just a newb myself =)

Anyway, your answer helped ALOT! I think I understand now.
Btw, I'm impressed you understood my question.

Thanks again.

Edited by - lowlevel on December 19, 2001 3:37:02 AM

This topic is closed to new replies.

Advertisement