Previous Next Index Thread

Re: PlaneSensor

Michael Paulitsch wrote:
> 
> Hi Hirohisa,
> Hi Uma,
> 
> Sorry for the confusion. If you try this piece of code you
> will realize that the Sphere will not move along the rotated
> coordinate system because the coordinates created by the
> PlaneSensor have a fixed Z value.
> 
> [example deleted...]
> 
> I want to go around an object rotate the planeSensor of that object
> according to the position of the avatar and I want to be able to
> move the object like if I had PlaneSensor perpendicular to the line
> of sight.
> 
> The problem: I can't use a SphereSensor because this is not implemented

What the heck does this have to do with a SphereSensor?

I would try combining a PlaneSensor with Billboard (if you want it
to face the viewer all the time).  I would first rotate the sensor
from the XZ plane to the XY plane (so that it stands up).
I haven't tried this out or thought about it much, but am
confident that you can do what you want (if I understand
what you want).


> So I thought that I can use a PlaneSensor and rotate according to
> the avatars position (which I get from a ProximitySensor) and will
> still get the same effect.
> Nope!

This should work too (but Billboard might be less work).
Why "nope"?


> My intention of that mail is to make clear that nobody can use a
> PlaneSensor if he rotates it.

Not true.


> Imagine you build a big box, you are inside the box and you want to
> move objects only on the "walls". If you use a SphereSensor
> you always get a "PlaneSensor" perpendicular to your line of sight.

Forget the SphereSensor... (for now)...


> If you use a PlaneSensor it works fine for the wall in the XY planes
> but not for any other planes!

This is wrong.  First, you need to understand that PlaneSensors
are designed to work in their LOCAL XY coordinate system (not
the global coord sys).  Thus, you an apply a Transform node to
rotate the PlaneSensor into the whatever orientation you wish.
However, you must be careful about how to apply the results.

If I was not busy on the spec, I would provide an example.
Maybe later...

 
> My personal opinion is that the guys who wrote the specification did
> think of that but didn't have a solution because of the
> fact that you can have 2D and 3D devices.

Not true.


> My objective is to start a discussion about the usefulness of a
> rotation field (similar to the offset field) in a PlaneSensor.

You can get the results you want (sorry that I don't have the time
right now to provide an example)...



> On Fri, 21 Feb 1997, Rikk Carey wrote:
> 
> > Nope.  The offset field has nothing to do with positioning (or
> > orienting) the sensor. Rather, if autoOffset is TRUE the offset
> > field is added to the results of the sensor's output
> > (e.g., translation_changed for PlaneSensor, rotation_changed
> > for SphereSensor).
> >
> > This feature provides the ability to give you persistent sensors. 
> > This  means that they will accumulate their results each time you
> > twiddle it, rather than reseting back to their original state.
> >
> > This is subtle.  I recommend that you experiment with it by setting
> > autoOffset to FALSE (do a test) and then set autoOffset to TRUE
> > (do a test).  In simple cases, you will typically ignore the value
> > of the  offset field itself (the sensor uses it internally).


--
Rikk Carey                                        rikk@best.com 
415-969-5910       VRML 2.0: http://vrml.sgi.com/moving-worlds/
-------------------------------------------------------------------
*** Please send administrative requests to <majordomo@sdsc.edu> ***
-------------------------------------------------------------------

Follow-Ups:

References: