[X3D-Public] Dragging things in screen-space

Bederov, Sergey bederov at cortona3d.com
Mon Oct 24 04:16:51 PDT 2011

Hello Dave,

A couple of suggestions:

1) PlaneSensor is applied only to nodes descendant from its parent group, and PlaneSensor always works in the Z=0 plane of its parent group. Therefore, to get the PlaneSensor working in an arbitrary plane, you will have to put it into a Transform with corresponding rotation, and put the desired geometry into the same Transform; to return the geometry to the original orientation, one more Transform will be required around the geometry. Then, the latter Transform can be moved according to the PlaneSensor output. The required rotation of the outer Transform can be obtained from a ProximitySensor. Though, it's not enough to ROUTE ProximitySensor to Transform and PlaneSensor to another Transform. First, the inner Transform's rotation must be the inverse of the outer. Second, if the inner Transform has been moved, and then the camera orientation changes, the inner Transform's translation must be adjusted in accordance with the parent Transform's rotation so that the geometry remains in the same place. So a Script will be required to handle these tasks.

2) You can simulate a PlaneSensor by a TouchSensor on a transparent plane. You can create a Group with a TouchSensor and a Billboard containing a large transparent plane. Then, moving the mouse over the plane will trigger TouchSensor's hitPoint_changed with global coordinates which can be ROUTEd directly to the desired Transform. Though, you will get problems if some shapes happen to be in front of this plane or intersecting it. You will still need a small Script to control the transfer of events and to enable/disable the TouchSensor at the right time.

                                             Sergey Bederov

> -----Original Message-----
> From: x3d-public-bounces at web3d.org [mailto:x3d-public-bounces at web3d.org] On
> Behalf Of Dave A
> Sent: Sunday, October 23, 2011 3:40 AM
> To: 'x3d public mailing list'
> Subject: [X3D-Public] Dragging things in screen-space
> Does anyone know of a way to drag something (like using a PlaneSensor) such
> that the result is being able to drag an object in the plane of the screen,
> no matter the orientation?
> I would have thought putting a drag sensor into a billboard
> (camera-facing) would get me close, but it's got problems. So I'm looking
> for a script or proto that can accomplish this. Or any tips on extensions
> like Device or Mouse sensor. Any platform, any player. Thanks
> Dave A.
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org

More information about the X3D-Public mailing list