Re: Getting screen coordinates for Performer object

New Message Reply Date view Thread view Subject view Author view

Mark Baranowski (baranowski++at++marklynn.demon.co.uk)
Tue, 21 May 1996 08:21:08 GMT


On Mon, 20 May 1996 20:40:33 -0700 (PDT), you wrote:

>
>Hi all,
>
>I want to make an HUD that I can use to "track" 3D objects
>in my scene with little 2-D marker boxes.
>
>The problem is:
>
>Given either a DCS matrix or a 3-dimensional set of
>world coordinates for an object, how can I calculate
>the two dimensional coordinate corresponding to where
>that point will be plotted in the viewport?

<snip>

> Is there another way to go about this?

Another approach to drawing HUD type symbology which must overlay the
real world, is to draw the symbology on a plane in 3D. Use coordinates
based on the angle subtended at the eye (more specifically the tan of
the angle subtended) and use a scale transformation before drawing
which scales in X and Z (assuming Y axis is into the screen) by the
distance of the plane from the eye.

Then the location of the centre of your target box is obtained from
some simple trig to calculate the azimuth and elevation of the target
position from the eye. X = tan(azimuth), Z = tan(elevation)

The distance from the eye to the symbology plane is irrelevant.

Regards

Mark.

-- 
Mark Baranowski at work (baranowski++at++marklynn.demon.co.uk)
Pera, VR Division. Melton Mowbray, Leicestershire. UK.
Tel: +44 1664 501501, Fax: +44 1664 501553
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer.html
            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:52:54 PDT

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