Hi Stefan,
I should preface this with the warning that I am not a programmer, so =
please
take what I have to say with a grain of salt.
>From my fuzzy understanding, I think that the basic problem is this:
In ARToolkit's use of openvrml, Each marker's 3D stuff is a separate =
.WRL
file - meaning that there are different 'worlds' on each marker. These =
are
typically loaded when you start up tour ARToolkit application=20
VRML is designed so that there is one 'world' that is parent to the =
various
geometries and behaviors within it. In VRML, information can be passed
between models via routing overseen by the parent world. Inside a vrml
world, you can have behaviors triggered by proximity of objects or =
anything.
VRML doesn't expressly allow for talking between worlds but you can do =
this
by using the scripting nodes. The scripting nodes use either javascript
(which can be written inside the .wrl file) or Java.
OpenVRML does not support all of javascript (although I think some =
people on
this list have got some simple scripts to work in ARToolkit) but it may =
be
possible to use java to set up communication with your main program via =
a
network socket.
I am not sure which version of OpenVRML is used in ARToolkit these days, =
but
it may be possible to get Java working with it with a bit of bashing =
around.
Once a network socket is established, it might then be possible to write =
to
any exposed field in a vrml model or set up triggers for behaviors or
animation interpolators.
Ideally, you would do this via javascript written inside the .wrl file =
so
that you don't have to keep opening up separate java programs every time =
you
want to change a behavior. This way, the java application is just a =
conduit
for the messages and can be left alone once it's established.
Of course, this depends on how well openvrml currently supports this =
dark
corner of the vrml97 specification but the more recent versions 'should' =
I
think.
Anyone else have any thoughts on this?
(The release of the DART project in the next few months might provide a =
much
easier way of doing this stuff)
http://www.cc.gatech.edu/projects/ael/projects/dart.html=20
Rod.
Rodney Berry
ATR Media Information Science Laboratories
Kyoto Japan
rodney@a ........
http://www.mis.atr.co.jp/~rodney
Ph: +81-774-95-1449
Fax: +81-774-95-1408
---------------------------------
-----Original Message-----
From: Stefan [mailto:sensorama@g ......]=20
Sent: Thursday, 4 December 2003 7:25 PM
To: rodney@a ........
Subject: vrml object manipulation
Hi rodney,
i have the same problem as you have.
i want to manipulate the loaded vrml file on the fly (i e change color =
of a
single element like a box)
you are sure that it is not possible with the ar toolkit?
i also didnt find a way to do this, but this does not mean that it is =
not
possible ;-)
(i m new to the toolkit)
my first idea was to load several dirfferent vrml objetc at startup and
change the vrml files associatet with a marker, so it would seem to =
change
only parts in the model.
so my idea was to change the vrml file with artoolkit ( a simple string
search and replace for example to change colors)
then save the manipulated vrml file and reload it on the fly.
so it maybe should be possible to change some parts in the vrml model
without loadeing several different vrml models.
this is what i am actually trying to do...
maybe this is a possibility for you and we can try to get this working
together :-)
stefan
|