Re: How to draw 3D object inside the HUD?

New Message Reply Date view Thread view Subject view Author view

Steve Baker (sbaker++at++link.com)
Thu, 30 Oct 1997 08:33:12 -0800 (PST)


On Thu, 30 Oct 1997, Ren-Jye Yu wrote:

> I am working on a flight simulator and using OpenGL to draw head-up
> display during the draw callback. I need to show 3D symbology on the HUD. These
> 3D symbology is a imagine 3D object in the space if you see through the HUD. Do
> you have any suggestion how to draw this 3D object on the HUD?
>
> I am thinking of creating the real "imagine" 3D object in my simulation
> environment and let this object show up only inside the HUD area. How can I
> show this object only inside the HUD area?

Presumably the imaginary 3D object drawn in the HUD would not be occulted by
objects in the 'real' world - and would not completely occult objects
in the real world.

That says that you need to either:

 * Turn off Z testing and setting when drawing this imaginary object
   and suffer from the fact that some parts of this object might not
   correctly occult each other - since the imaginary object is presumably
   translucent (so you can sse the real world through the HUD), this lack
   of proper Z buffering could be a bad problem. To stop the object from
   being drawn outside the area of the HUD, you'd have to set the OpenGL
   Scissors to the size of the HUD in the pre-draw callback and restore
   them again afterwards

 ...or...

 * Draw the 'real' world, clear the Z buffer and then draw the imaginary
   HUD object (with transparency enabled).

The second approach sounds best to me - if you do that then you could
use a separate Performer channel to draw the HUD - ensuring that the
colour planes of the screen are not cleared by Performer - but the Z
planes are. Setting the size of the overlayed second channel to the
size of the HUD will ensure that your imaginary object doesn't get
drawn outside the area of the HUD.

Be careful when setting the field-of-view of the HUD channel to
ensure that it matches the out-the-window channel.

The penalty for this second approach is the cost of clearing the Z planes
twice for the region of the screen under the HUD. If you are fill-limited
then you might be forced to consider the first solution.

Steve Baker 817-619-8776 (Vox/Vox-Mail)
Hughes Training Inc. 817-619-4028 (Fax)
2200 Arlington Downs Road SBaker++at++link.com (eMail)
Arlington, Texas. TX 76005-6171 SJBaker1++at++airmail.net (Personal eMail)
http://www.hti.com http://web2.airmail.net/sjbaker1 (personal)

** Beware of Geeks bearing GIF's. **

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:09 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.