Previous Next Index Thread

Re: PlaneSensor

On Fri, 21 Feb 1997, Rikk Carey wrote:

> 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?

Sorry, I mixed something up! Of course it has nothing to do with a

> 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).

That's exactly what I have done but this doesn't alter the fact that
one has to write a script with matrix calculation just because
he wants his PlaneSensor to be a little bit rotated!

> > 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"?

Because I made a mistake in programming it ;-) Sorry for the nope
I have located my mistake now. It's a kind of event misordering thing that
I didn't think of and has principally nothing to do with a PlaneSenser.

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

In my first posting I made clear that one could use a Script node
to "adjust" the coordinates. In my opinion, nobody should have
to use a Script node just because he wants to have his PlaneSensor

> > 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)...

OK!!! ;-)

> > 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.

I recognized that fact!! But as I said, one shouldn't have to write
a script to do so.
If you have another simpler solution then please tell it to us! 

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

Would be very nice!

> > 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.

It was my opinion, sorry!

> > 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)...

Please, would be nice. But *without* a Script node. I know how to do
it with a script node.

Once again, the reason why I wrote this mail is to point this fact
out and maybe you can think about it when you write the spec.
It's no big deal to add a rotation field and it would make things
As I said, it's my personal opinion and you don't have to agree
but I feel better now because I know that somebody who wrote/writes
the spec knows it now.

I tried/try to give some feedback!! Hope you appreciate that and that you
don't see it as a critic on the spec. You did a great Job, thanks!

PS: I'm eagerly waiting for the next IRIX beta version!

> > 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                               
> 415-969-5910       VRML 2.0:

--- Michael PAULITSCH ---------- ---

*** Please send administrative requests to <> ***