[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Thread Index]
[Monthly Archives] [List Home]

RE: [Virtools] Moving Objects using the mouse.



Title: Message

Hi,
 
This is Great, but it will move the object up and down and from side to side.
I'm trying to move an object along the XZ plane of another object.
 
the example : There is a Table with a Box on it. I want to move the Box around the table using the mouse. Same as Moving it in Dev in the XZ world plane.
 
 
Best regards,
 
Kam Memarzia
 
 
 
 
 -----Original Message-----
From: ChrGarnier [mailto:chrgarnier@wanadoo.fr]
Sent: 09 April 2002 12:06
To: Kam Memarzia; 'Virtools Mailing List'
Subject: RE: [Virtools] Moving Objects using the mouse.

Hello,
 
Please find the equations down there:
 
XYZ are 3D coords of a point IN CAMERA REF
xy are screen coords as per the near clipping plane.
WH are width and height of the screen
then we have:
X=Z*tan(fov/2)*(2*x/W-1);//1
Y=Z*tan(fov/2)*(H-2*y)/W;//2
 
You need the object Z  (picked position) and transform it into the camera ref.
Then you position the object on a plane perpendicular to the camera dir at Z,
using X,Y.
 
Best regards,
 
Christian Garnier.

 -----Message d'origine-----
De : owner-virtools-user-group@lists.theswapmeet.com [mailto:owner-virtools-user-group@lists.theswapmeet.com]De la part de Kam Memarzia
Envoyé : mardi 9 avril 2002 10:18
À : 'Virtools Mailing List'
Objet : [Virtools] Moving Objects using the mouse.

Greetings,

I'd like to replicate the Move function in Dev within a cmo using the mouse.

So that once the object is clicked on, it can be dragged around in a plane (say X,Z) - whilst staying underneath the mouse.

Its translating the screen co-ordinates into world space I think.

Any clues, thoughts, equations or solutions would be most appriciated.

Thanks

Kam Memarzia




Follow-Ups: