Re: certainly already asked

New Message Reply Date view Thread view Subject view Author view

Martin Reddy (mxr++at++dcs.ed.ac.uk)
6/6/96 2:43 PM


Received: from octagon.tacom.army.mil by cc.tacom.army.mil with SMTP
  (IMA Internet Exchange 1.04b) id 1b702581; Thu, 6 Jun 96 12:07:53 -0400
Received: from sgigate.sgi.com by octagon.tacom.army.mil (8.7.5/8.7.3-kbp) with S
MTP
        id MAA20294; Thu, 6 Jun 1996 12:09:03 -0400 (EDT)
Received: from holodeck.csd.sgi.com by sgigate.sgi.com via ESMTP (950911.SGI.8.6.
12.PATCH825/940406a.SGI)
         id JAA02831; Thu, 6 Jun 1996 09:06:18 -0700
Received: by holodeck.csd.sgi.com (950413.SGI.8.6.12/940406.SGI.AUTO)
        for info-performer-dist++at++holodeck.csd.sgi.com id GAA03699; Thu, 6 Jun 1996 06:44:
12 -0700
Received: from rock.csd.sgi.com by holodeck.csd.sgi.com via ESMTP (950413.SGI.8.6
.12/940406.SGI.AUTO)
        for <info-performer++at++holodeck.csd.sgi.com> id GAA03683; Thu, 6 Jun 1996 06:44:11
-0700
Received: from sgi.sgi.com by rock.csd.sgi.com via ESMTP (950413.SGI.8.6.12/91080
5.SGI)
        for <info-performer++at++relay.csd.sgi.com> id GAA24483; Thu, 6 Jun 1996 06:44:10 -07
00
Received: from rainich.dcs.ed.ac.uk by sgi.sgi.com via ESMTP (950405.SGI.8.6.12/9
10110.SGI)
        for <info-performer++at++sgi.com> id GAA02382; Thu, 6 Jun 1996 06:44:07 -0700
Received: from flugga.dcs.ed.ac.uk by rainich.dcs.ed.ac.uk with SMTP (PP);
          Thu, 6 Jun 1996 14:44:00 +0100
Received: from localhost by flugga.dcs.ed.ac.uk; Thu, 6 Jun 1996 14:43:57 +0100
Date: Thu, 6 Jun 1996 14:43:56 +0100 (BST)
From: Martin Reddy <mxr++at++dcs.ed.ac.uk>
To: ceti <ceti++at++worldnet.net>
Cc: info-performer++at++sgi.com
Subject: Re: certainly already asked
In-Reply-To: <199606041559.RAA16528++at++storm.certix.fr>
Message-Id: <Pine.SOL.3.93.960606141157.28115A-100000++at++flugga.dcs.ed.ac.uk>
Organisation: Department of Computer Science - University of Edinburgh
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

I will need to do the same thing soon (making a track box for an object in world
space). My approach will probably be something like this:

        pfVec3 screen_pos, world_pos;
        (get world position)
         
        pfMatrix view_mat, temp_mat;
        pfCoord chan_offsets;
        pfGetChanViewMat(chan, mat);
        pfGetChanViewOffsets(chan, chan_offsets.xyz, chan_offsets.hpr);
        pfMakeCoordMat(temp_mat, &chan_offsets);
        pfPreMultMat(view_mat, temp_mat); // postmultiply instead? can't
                                           // remember offhand
         
        pfXformVec3(screen_pos, world_pos, view_mat);

I think that the x,y values in screen_pos will then be the (normalized?) screen
coordinates of the world point. I may have missed a few steps, as I haven't
actually tried this. Anybody else have suggestions/comments? It definitely
would be nice to have a project_point function in Performer, perhaps as part of
the pfChannel API.

Don Tidrow
Visual Simulation Developer
US Army TACOM

______________________________ Reply Separator _________________________________
Subject: Re: certainly already asked
Author: Martin Reddy <mxr++at++dcs.ed.ac.uk> at TWLAN-SMTP
Date: 6/6/96 2:43 PM

> Does anybody have, or does this exist in Performer, a function that
> computes from 3D coordinates to 2D screen coords ?

This is something that I am interested in too. I have seen a few posts
asking this in the past, but never any answers. For myself I need to be
able to compute the size (e.g. projected bounding sphere diameter) and
position of objects in (2D) screen coordinates.

I gather that this is not possible in Performer? (but I'd love to be
proved wrong). As a result I am considering re-inventing the wheel and
manually performing perspective projections on each of my objects. In
order to ensure that I'm doing the same calculations that Performer is
doing to display the object, can anyone on the Performer Team direct me
towards a source (or better yet, source code) which Performer uses to
implement its perspective projection (is it just your standard algorithm
ala Foley & van Dam?).

As a future feature suggestion, I would think that being able to access or
compute the 2D projected coords for objects would be a fairly useful API
feature?? Just my opinion :-)

Cheers,

Martin.

+============================================================================+
| Martin Reddy Dept. of Computer Science |
| University of Edinburgh |
| e-mail : mxr++at++dcs.ed.ac.uk Mayfield Road, EH9 3JZ |
| http://www.dcs.ed.ac.uk/home/mxr/ Tel : (0131) 650 5164 |
+============================================================================+

=======================================================================
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:59 PDT

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