[X3D-Public] Moving Objects around per mouse click

Bederov, Sergey bederov at cortona3d.com
Wed Feb 24 00:40:19 PST 2010


Hello Martin,

You can attach a TouchSensor to the floor object and use a Script to
handle its events. First, put a TouchSensor node into the same Group or
Transform with the floor (probably you will have to create a Group if
the floor doesn't have one). Then, add ROUTEs from the TouchSensor's
"touchTime" and "hitPoint_changed" events to a Script. When the Script
receives the "hitPoint_changed" event, it stores its value into a field.
When it receives the "touchTime" event, it retrieves the stored value
and sends it to the "translation" field of the Transform containing the
box.

                                         Sergey Bederov



-----Original Message-----
From: x3d-public-bounces at web3d.org [mailto:x3d-public-bounces at web3d.org]
On Behalf Of Martin Palma
Sent: Monday, February 22, 2010 7:34 PM
To: x3d-public at web3d.org
Subject: [X3D-Public] Moving Objects around per mouse click

Hello,
Is it possible to move, let's say a box from one position in a scene
to a new position with a "click event". I mean: I have a scene with a
floor object. On that floor object there sits at some position a box.
Now when I click somewhere on my floor the box moves to that position?

Thanks for any help.

Bye,
Martin

_______________________________________________
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