[WWW-Vrml] Solution(?) + vrml examples Re: PlaneSensor Issues

Ivan Klíma ivan at mymail.cz
Thu Jun 30 12:27:31 PDT 2011


Hello Matthew,

I am glad to see somebody is still playing with vrml:-)

I have taken just very very brief look to your code, so my suggestion may not be quite in compliance with your need,
but the following seems to work nicely.

Some examples of "applied" VRML - Lunar Module, crossectioned Gripen fighter etc - can be found on my old Cortona-based VRML site devoted to air&space technical VRML visualizations:
www.spg.cz/ivan/
in section "Showroom".

This might be the solution to your problem, with no scripts etc. needed:

#VRML V2.0 utf8
Group{
children[
DEF box Transform {
translation 0 0 -10
children [
Shape {
appearance Appearance {
material Material{
diffuseColor 1 0 1
}
}
geometry Box {
size 2 2 .05
}
}
]
}
DEF PS PlaneSensor {
#translation_changed 0 0 -10
#trackPoint_changed 0 0 -10
offset 0 0 -10
enabled TRUE
autoOffset TRUE
}
]
}
ROUTE PS.translation_changed TO box.set_translation
#end of vrml file

For further study - besides the web, of course - I would recommend the great book written by Ames, Nadeau, Moreland called "VRML 2.0 Sourcebook" (ISBN 0-471-16507-7).
I bought it back in 1997 when the VRML seemed to be The Big Thing, and up to now I have not found anything which would include more detailed reference, explanation and examples of all aspects of VRML specs.

Regards

Ivan Klima
www.spg.cz/ivan



______________________________________________________________
> Od: "Matthew Fox" <matthewmfox at gmail.com>
> Komu: www-vrml at web3d.org
> Datum: 29.06.2011 19:51
> Předmět: [WWW-Vrml] PlaneSensor Issues
>
>Hi,
>
>I have been working with drag sensors, specifically the PlaneSensor, and I
>have come across an issue with the trackpoint feature of the PlaneSensor.  I
>am attempting to drag a box along the xy plane that is positioned -10 units
>along the z plane.
>Because of this, I set my own offset to 0, 0, -10 for the sensor, but the
>dragging motion became very jumpy due to the lack of correction that I took
>away by setting my own offset, and the box did not translate exactly with
>the mouse, but a good bit less.  Therefore, I wrote a script to feign an
>autoOffset and routed it to the set_offset field of the PlaneSensor so that
>it would begin where the last drag had ended.  This works very well in all
>cases except for the first attempt at dragging, which behaves as it did
>before.  Also, when a second click is activated, the box jumps to correct
>its translation and then acts on the correct translation of the mouse.  I
>was wondering if any of you would know how to fix it to correct for this
>problem.  I'll attach some sample code to this message.  Thanks so much.
>
>Sincerely,
>Matt
>
>_______________________________________________
>Www-vrml mailing list
>Www-vrml at web3d.org
>http://web3d.org/mailman/listinfo/www-vrml_web3d.org
>
>



More information about the Www-vrml mailing list