[X3D-Public] X3D: How to change url of Movietexture node? (on the fly)
Dark Before Dawn
dark.before.dawn at gmail.com
Mon Jun 22 02:19:53 PDT 2009
Hi there,
I am trying to create a multimedia room with a beamer and canvas. The
user shall be albe to select different movie-clips from a shelf. After
selecting a movie, the clip can be started by pressing the playbutton
which is located on the top of the beamer.
Expected behaviour:
1. select a movie from shelf
2. go to the beamer and press play button
-> selected movie is played and displaced on canvas
My question is now: How can I change the canvas's movie texture url? Is
there a way to exchange the movie url node via javascript or with a sensor?
This is my current implementation:
....
<Transform translation="-1.7 2 -1.5">
<Shape DEF='MovieShapeDefault'>
<IndexedFaceSet solid='false' coordIndex='0 1 2 3'>
<Coordinate point='-1.6 -1.2 0 1.6 -1.2 0 1.6 1.2 0 -1.6 1.2 0'/>
<TextureCoordinate DEF='FullImageMapping' point='0 0 1 0 1 1 0 1'/>
</IndexedFaceSet>
<Appearance>
<MovieTexture DEF='Mov1' repeatS='false' repeatT='false'
url=' "test.mpg" '/>
</Appearance>
</Shape>
</Transform>
<Collision enabled="true">
<Transform DEF="Cube_002" translation="-1.651645 0.9 2.717824"
scale="0.323180 0.229653 0.131876" rotation="-0.554344 0.554344 0.620811
2.030430">
<Shape>
<IndexedFaceSet solid="true" coordIndex="0 1 2 3 -1, 4 7 6 5 -1, 0 4 5 1
-1, 1 5 6 2 -1, 2 6 7 3 -1, 4 0 3 7 -1, ">
<Coordinate DEF="coord_Cube_002"
point="1.000000 1.000000 -1.000000, 1.000000 -1.000000
-1.000000, -1.000000 -1.000000 -1.000000, -1.000000 1.000000 -1.000000,
1.000000 0.999999 1.000000, 0.999999 -1.000001 1.000000, -1.000000
-1.000000 1.000000, -1.000000 1.000000 1.000000, " />
</IndexedFaceSet>
</Shape>
</Transform>
<TouchSensor DEF='Projektor' description='Abspielen'/>
<ROUTE fromNode='Projektor' fromField='touchTime' toNode='Mov1'
toField='startTime'/>
</Collision>
...
Cheers and tia.
More information about the X3D-Public
mailing list