> I am trying to make a vrml scene viewer.
> Right now I am trying to figure out how to get and move from one
> viewpoitn to another one. This view point are defined in the vrml
> file, but I don t know how to do it...
If i understood right, what you want, you can simply use a
positioninterpolator and a orientationinterpolators with the values
from the viewpoint as start and end values. E.g.
#VRML V2.0 utf8
DEF Viewpoint1 Viewpoint
{
orientation 0 -1 0 0.142949
position 0 -0.847810 9.943069
description "moving"
}
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Cylinder
{
}
}
]
translation -4.251791 -3.051850e-2 -0.446307
}
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Cone
{
}
}
]
translation 4.695546 0 0
}
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Sphere
{
}
}
]
translation 0 4.117030 0
}
Transform
{
children
[
Shape
{
appearance Appearance
{
material Material
{
}
}
geometry Box
{
}
}
]
translation 0 0 -17.250835
}
DEF PositionInterpolator1 PositionInterpolator
{
key
[
0
1
]
keyValue
[
0 0 9.920000
0 -2.939999 10
]
}
DEF OrientationInterpolator1 OrientationInterpolator
{
key
[
0
1
]
keyValue
[
0 -0.999997 0 5.235927e-2
0 -1 0 0.366519
]
}
DEF From Viewpoint
{
orientation 0 -1 0 5.235927e-2
position 0 0 9.920000
description "From"
}
DEF To Viewpoint
{
orientation 0 -1 0 0.366519
position 0 -2.939999 10
description "To"
}
DEF TimeSensor1 TimeSensor
{
cycleInterval 1.960000
loop TRUE
}
ROUTE TimeSensor1.fraction_changed TO OrientationInterpolator1.set_fraction
ROUTE TimeSensor1.fraction_changed TO PositionInterpolator1.set_fraction
ROUTE OrientationInterpolator1.value_changed TO Viewpoint1.set_orientation
ROUTE PositionInterpolator1.value_changed TO Viewpoint1.set_position
bart59 - 16 Oct 2003 12:00 GMT
Actually my problem is to get the viewpint FROM the vrml in the
java3D, where I would be able to make the translation.
Otherwise, I am using a vrmlloader (vc97), which doesn't look like to
understand the ROUTE ...
//output:
CyberVRML97 warning : Loading Error (ParseException) =
java.io.InputStreamReader@1a99561
Encountered "ROUTE" at line 21490, column 1.
//end
I tried to remove i manually, but then I've got another error...
java.lang.IllegalArgumentException: IndexedTriangleArray: illegal
indexCount
I am using the 3dsmax vrml exporter.