[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: access to single values
Hi,
A VRML file in which an object moves to the user clicked position is
attached. Here user has to click on different positions inside VRML
itself. I dont know any ways to achieve this by clicking on HTML text,
(EAI should support this in future) but EAI can be used to realize the
effect using Java, where user clicks on Button/text in a Java applet.
:The velocity of object's transition can be made uniform by setting
the Timer's cycleInterval according to the distance of transition.
regards,
s.r.i.k.u
^v^v^v^v^v^v^v^v^v^
Mb.sRiKuMaR
Tata Elxsi (I) Ltd.
Bangalore, India.
091.080.8452016/17
sriku@teil.soft.net
v^v^v^v^v^v^v^v^v^v
On Mon, 7 Jul 1997, Andrea wrote:
> >Hi everyone,
> >
> >I have an idea, and I think it is possible, but I don't know how to
> >realize it.
> >An Object and five Positions and Orientations.
> >Now the user can activate (per click on text in HTML) one Position, and
> >the Object moves to there.
> >The values for the Interpolators have to be generated dynamicaly,
> >StartValue ist the latest Positon and EndValue the clicked-one. The
> >Positions can be shown in different order, not 1 -> 2 -> 3 -> 4 -> 5,
> >but also 3-> 2-> 5 -> 1 -> 4 a.s.o.
> >I'm not so virtus in Java, but how could I realize this access and
> >funktion from HTML (embedded or even better in another Frame).
> >
> >Thank you
> >Andrea
> >
> >andrea@identity.de
> >
> -------------------------------------------------------------------------
> for list subscription instructions,
> send email to www-vrml-request@vrml.org with text "info"
>
>
#VRML V2.0 utf8
Group {
children [
Transform {
translation -2 0 0
children [
Shape {geometry Box{size .2 1 .1}},
DEF click1 TouchSensor{}
]
},
Transform {
translation 0 0 0
children [
Shape {geometry Box{size .2 1 .1}},
DEF click2 TouchSensor{}
]
},
Transform {
translation 2 0 0
children [
Shape {geometry Box{size .2 1 .1}},
DEF click3 TouchSensor{}
]
},
DEF Obj Transform {
children Shape {appearance Appearance {
material Material { diffuseColor 1 0 0 }}
geometry Sphere{radius 0.3}
}
}
]
}
DEF posInterp PositionInterpolator {
key [0,1]
keyValue [0 0 0, 2 0 0]
}
DEF timer TimeSensor {}
DEF SC Script {
eventIn SFTime click1Time
eventIn SFTime click2Time
eventIn SFTime click3Time
eventOut MFVec3f newKeyValue
eventOut SFTime startTimer
field SFVec3f keyValue1 0 0 0
url "vrmlscript:
function click1Time(val) {
keyValue2 = new SFVec3f(-2,0,0);
newKeyValue = new MFVec3f (keyValue1, keyValue2);
startTimer = val;
keyValue1 = keyValue2;
}
function click2Time(val) {
keyValue2 = new SFVec3f(0,0,0);
newKeyValue = new MFVec3f (keyValue1, keyValue2);
startTimer = val;
keyValue1 = keyValue2;
}
function click3Time(val) {
keyValue2 = new SFVec3f(2,0,0);
newKeyValue = new MFVec3f (keyValue1, keyValue2);
startTimer = val;
keyValue1 = keyValue2;
}"
}
ROUTE click1.touchTime TO SC.click1Time
ROUTE click2.touchTime TO SC.click2Time
ROUTE click3.touchTime TO SC.click3Time
ROUTE SC.newKeyValue TO posInterp.set_keyValue
ROUTE SC.startTimer TO timer.set_startTime
ROUTE timer.fraction_changed TO posInterp.set_fraction
ROUTE posInterp.value_changed TO Obj.set_translation
References:

