Re: Drag & Drop

New Message Reply Date view Thread view Subject view Author view

Alejandro Saez (cano++at++krusty.engr.sgi.com)
Sat, 7 Mar 1998 11:38:35 -0600


On Oct 21, 2:31pm, Anda Singer wrote:
> Subject: Drag & Drop
> Hi,
> I want to drag and drop an object in my Performer application scene.
>
> What is the best way to translate the screen (x,y) coordinates to the
> scene (world) coordinates?
>
> Thanks
> --
> Anda
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Anda Singher anda++at++cs.technion.ac.il
> tel: 04-8293905
> http://www.cs.technion.ac.il/~anda/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think this is a subject on its own because it has to do with what is
intuitive to the user. The problem is that when going form 3D to 2D (world to
screen) this transformation is unique, that is, a 3D point in space will map to
one and only one point on screen space (if within the viewing fustrum) the
opposite it's not true and a point on the screen can go to anyone infinite
points in 3D space, these points form the line going from the observer's eye,
passing through the (x,y) screen coordinate and extending to the infinite in
that direction (well, up to the far clipping plane, but there still are
infinite points in that finite line segment). Imagine looking straight forward
and be facing a line that is parallel to your viewing direction, the way you'll
see that line will be a point in the screen, any point along that line will
project to the same pixel on screen thus being perceived as a point. You are
asking, given I have a point on screen, where along the line is it? there is no
way to know, you dropped that information (the Z component) while projecting.
But there are ways to overcome this and again, that is a subject on its own.
Most approaches involve doing this on a two (or n) steps basis. Since you can
only specify 2 coordinates at a time, you first specify 2 of them (say look
along the +Y axis direction, and define the x,z coordinates) and then change
the observer's position and orientation, so that now you can specify the 3rd
coordinate, usually leaving the already specified coordinate fixed (say now,
you look down the -Z axis so you can specify the x,y of which x might be
fixed). Almost all aprroaches are a variation of this, but the one I like most
is the one used by Multigen. Since you can only specify 2 coordinates, leave
the third fixed before you drag and drop. This is accomplished by using a
tracking plane which you define before starting the drag and drop bit, this
plane is where any object is allowed (or constrained) to move and will make
any 2D movement of the mouse move the object along the 2D plane, but the plane
itself defines the 3d coordinate. Other approach is to have more than a view to
the scene (usally 3) so that, as an example, you can define X,Y in one, X,Z in
the other and Y,Z in the third. There is still a another one I haven't seen
implemented but I wonder if it would work and goes like this: Drag the object
so that a point of interest in the object lays on the x,y pixel you want it to
be (that point of interest could be the object geometrical center), then with
the mouse button pressed move the mouse so that moving the mouse up, moves the
object away from the observer along the line of sight defined by the observer
and the (x,y) screen cordinate, and moving it down, moves the object closer
along that direction. What if you don't want to place an object along that
line? Well you could move the observer and/or database first so that the
desired final position of the object is along that line of sight. I don't know
if it would work, but usually none of the methods I've described are sufficient
on their own and most software packages offer a combination of them. Which is
best? I think it heavily depends on what the user finds intuitive and on other
subjects such as how the mouse 2D movements are interpreted as 3D movements
which also has to be intuitive.

        Sorry for the lenght of my response, but I hope it helps, at least at
the conceptual level.

-- 
------------------------------------------------------------------------
Alejandro Saez
Software Engineer
Silicon Chile S.A.
                                        Avda. Santa Maria 2560
E-mail: asaez++at++silicon.cl              	Providencia
Phone:  +56 (2) 203 3371 Ext. 107 		Santiago
Fax:    +56 (2) 203 3370                Chile
------------------------------------------------------------------------

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Oct 21 1998 - 07:40:59 PDT

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