[X3D-Public] Sensors: PlaneSensor XYZ and combined Sensors

Bederov, Sergey bederov at cortona3d.com
Wed Jul 27 00:46:24 PDT 2011


Hello Dark and Dave,

You can create an object consisting of several shapes with different sensors on each, for example, several PlaneSensors and a SphereSensor. Then you will most likely have to add a Script which will process events from all these sensors, recalculate the values from one coordinate system to another, change offsets etc. This way you can create a "manipulator" with various "handles" which move it in different directions and rotate around different axes.

In VRML, a PlaneSensor is always working in the XY plane. Wrapping the sensor by a Transform allows to change this plane, but the active geometry must be put into the same Transform (or into one more Transform to rotate it back to the correct position). Also, various coordinate system transformations must be performed by a Script. I see that in X3D the PlaneSensor has an axisRotation field specifying the desired plane, it should simplify things greatly.

I think that in X3D the simplest way to get a PlaneSensor working parallel to the screen is to ROUTE orientation_changed from a ProximitySensor to the PlaneSensor's axisRotation. Though, it's not obvious to me how the dragged object will move when the camera orientation changes.

                            Sergey Bederov



> -----Original Message-----
> From: x3d-public-bounces at web3d.org [mailto:x3d-public-bounces at web3d.org] On
> Behalf Of Dave A
> Sent: Wednesday, July 27, 2011 1:50 AM
> To: x3d-public at web3d.org
> Subject: Re: [X3D-Public] Sensors: PlaneSensor XYZ and combined Sensors
> 
> While at it, I've been in need of a way to orient them such that I'm always
> dragging in the plane of the screen, such that up/down on screen is Y in
> world (assuming I'm facing normally), and X drags on the XZ plane depending
> on rotation. And should be arbitrary orientation.
> 
> On 7/26/2011 2:32 PM, Dark Before Dawn wrote:
> > Hi guys,
> > is there a way to combine two planesensors to achive a dragging
> > behaviour in XZ plane and also +-Y direction? My current
> > implementation uses rotations to switch between XZ movement and Y
> > movement.
> >
> > I also wonder if there is a way to combine multiple sensors like a
> > planesensor to drag objects around and a sphere sensor to rotate the
> > same object? While writing this mail I perceived that touchsensor
> > toggles could be an option.
> > Cheers Darky
> >



More information about the X3D-Public mailing list