Re: constant screen size of an object

New Message Reply Date view Thread view Subject view Author view

Glenn Waldron (gwaldron++at++peril.com)
Wed, 12 Mar 1997 09:17:42 -0500


Juan R. Saenz-Diez wrote:
>
> Dear Performers,
>
> I want to draw an object in 3D space, scaling it so as to make it appear
> of a constant size when projected on screen. What scaling matrix should
> I apply before drawing (let's suppose that the object has a original
> size of 1) so that I get the target size on screen?
>

This seems to work pretty well:

  pdist = perceived distance (i.e., you want the object to look as
          though it is this far away);
  dist = current distance between eyepoint and object;
   
  dcs->scale( dist / pdist );

The matrix would be:

   r = dist/pdist;

   m = [ r 0 0 0
         0 r 0 0
         0 0 r 0
         0 0 0 1 ];

-- 
Glenn Waldron - ANSER Leading Edge Technologies  phone/PCS: 703.598.7835
email: gwaldron++at++peril.com                       voice mail: 703.416.8462
=======================================================================
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:54:53 PDT

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