🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x.pex
Article #79

Re: 3d WC from Cursor Position

#79
From: Keith Baccki
Date: Thu, 03 Sep 1992 18:11
48 lines
3024 bytes
In article <1992Sep2.152701.20934@dsd.es.com> cannon@ziggy.es.com (Gary Cannon) writes:
>In article <1992Sep1.212308.19369@bmw.mayo.edu>, Kall@Mayo.EDU writes:
>> I guess what I was wondering (or dreaming of) is:
>> 
>> Yes the cursor 'sits over a pixel in the 2D device coordinate space
>> of the screen'.  The escape X_DRAWABLE_TO_WC_POINTS
>> returns some 3d location based on the X,Y drawable
>> location and some Z  value you pass in.  
>> 
>> Isn't there anyway for Phigs to  figure out  from the
>> scene what pixel the 2d cursor is sitting on (i.e. traverse the
>> whole scene from Z-min to Z_max  for that 2d X,Y coordinate
>> and find out what the 3d WC coordinate is of the pixel that you
>> are seeing on the screen.  After traversal  doesn't only one 3d WC coordinate
>> deposit that pixel even if structures overlap? 
>
>What you are asking for is PHIGS picking. You need to be using a IN/OUT
>workstation type and look at the description of the input functions
>for INITIALIZE PICK 3, SET PICK MODE (I recommend event mode), AWAIT EVENT,
>and GET PICK.


	If you want a coordinate from world coordinate space, picking
won't work for you as it returns the structure instance from the CSS
which the user has "picked". Is this what you want? Or do you actually
want some (x,y,z) from WC space? I guess I don't completely understand
what you're asking since, for instance, you mention "traversing" the
scene in Z given an (x,y) to find a 3d coordinate, and (reverse-)mapping
your DC space to WC space in the same sentence, but they don't really 
have anything to do with each other...

If you want a coordinate, sample a "locator" device. 
If you want to select a structure element directly, 
sample a "picking" device.

Alternatively, if you want to interactively select coordinates in
WC space, just create a 3-D cursor where it's position is translated
in the X-Y plane by mouse movement in X-Y with the middle button down,
and depth is given by movement in the X (xor Y) direction with the 
right button down. (You need a 3 button mouse for clicking, though.)
The cursor is drawn as three single polylines, and you always know
the coordinates of it's orthocenter in WC since that's where you
define it. Also, you can map whatever DC delta to WC delta you want
(i.e. for every three pixels, move the cursor 0.3 units, or whatever).
It's crude, but I've used this method effectively in the past.


			- Keith
Technical Details
Message-ID: <95307@bu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!bu.edu!bass.bu.edu!kiki
References: <1992Sep1.194434.2724@dsd.es.com> <1992Sep1.212308.19369@bmw.mayo.edu> <1992Sep2.152701.20934@dsd.es.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!bu.edu!bass.bu.edu!kiki
From: kiki@bass.bu.edu (Keith Baccki)
Newsgroups: comp.windows.x.pex
Subject: Re: 3d WC from Cursor Position
Message-ID: <95307@bu.edu>
Date: 3 Sep 92 18:11:05 GMT
References: <1992Sep1.194434.2724@dsd.es.com> <1992Sep1.212308.19369@bmw.mayo.edu> <1992Sep2.152701.20934@dsd.es.com>
Sender: news@bu.edu
Reply-To: kiki@bass.bu.edu (Keith Baccki)
Followup-To: comp.windows.x.pex
Organization: Boston University
Lines: 48