This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > December 2003 > VRML + JAVA + C to access position Variables





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author VRML + JAVA + C to access position Variables
Patrick

2003-12-18, 8:46 pm

Hi
I have read several news articles but I haven`t found a solution for
my problem. I have a tracking device which has functions in C to
access position, rotation ... and I want to have these values in VRML
to move an object in the same way as in reality. Everything works fine
but the big problem is now that when I load my VRML file I can`t
access my dll file I created with the JNI interface from JAVA. I think
the problem is that the applet has not the rights to access the file.
If I try to sign the file as a jar file I can`t access it from VRML
because you can only call class files with the "url" command. So what
I want to know is what can I do to solve this problem or does anybody
has experience with this. I appreciate any hints.

Thanks Patrick
Herbert Stocker

2003-12-18, 8:46 pm



Patrick wrote:
quote:

> Hi
> I have read several news articles but I haven`t found a solution for
> my problem. I have a tracking device which has functions in C to
> access position, rotation ... and I want to have these values in VRML
> to move an object in the same way as in reality. Everything works fine
> but the big problem is now that when I load my VRML file I can`t
> access my dll file I created with the JNI interface from JAVA. I think
> the problem is that the applet has not the rights to access the file.
> If I try to sign the file as a jar file I can`t access it from VRML
> because you can only call class files with the "url" command. So what
> I want to know is what can I do to solve this problem or does anybody
> has experience with this. I appreciate any hints.
>
> Thanks Patrick



With BS Contact VRML you can load a DLL directly into a Script node.
To be more precisely, in the Script node you can specify the class ID
of a COM object, which is located in a DLL.

(If loading COM objects from VRML sounds unsafe to somebody:
BS Contact loads a DLL only if the DLL has registered itself
with BS Contact using the registry.)

You can also write an extension for the DeviceSensor node, which
is a Sensor node for arbitrary input and output devices.

Herbert


--
Herbert Stocker (aka hersto)
http://www.hersto.de
www.bitmanagement.de

P. Flavin

2003-12-18, 8:46 pm


Java does 3d animation and can connect to devices
---------------------- and to machines directly
with JNI ( through one programing interface )
or with networked computers with standard
Internet Protocols including Client / Server
connections on multiple machines, or on one.

For creating 3d objects, worlds, or animations
that must connect to controlling devices such
as head mounted displays and game controlers
and other more serious applications __ Java3d __
might be a better solution than the using the
old style VRML plug-in viewers which have many
problems of security and portability.

Nasa uses Java3d for their Mars Rover controller and
3d simulation program ( the WITS program )

and it uses ____ VRML ____

and it's a networked application
you can get and use, for free ( see the URL below ).


Patrick wrote:
quote:

>
> I have a tracking device which has functions in C
> to access position, rotation ... and I want to
> have these values in VRML to move an object in
> the same way as in reality.
>
> Everything works fine but the big
> problem is now that when I load my VRML
> file I can't access my dll file I created
> with the JNI interface from JAVA.
>
> I think the problem is that the applet has
> not the rights to access the file.
>
> If I try to sign the file as a jar file
> I can't access it from VRML because you
> can only call class files with the "url"
> command.
>
> So what I want to know is what can
> I do to solve this problem or does anybody
> has experience with this.
>
> I appreciate any hints.
>
> Thanks Patrick
>




More details please ...


Java3d can animate VRML in a browser as applet,
----------------------------------------------
and you can ( and I have ) controlled 3d objects
using Java3d in an applet using a simple client /
server connection, and you could solve your problem
that way, using the built in networking capabilities
of Java: just create and open a Socket and read and
write through the pipe.

This neatly divides your problem into two distinct,
smaller ( and simpler ) problems which is a good
programing methodology.

Use your device, C interface, JNI, and create a
simple Client / Server pair : get that working,
then add that Client connection capability
to your Java 3d client applet.

If running it as an application ( not in a browser )
is an option ( and desired ): it's even simpler.


What's your model ?

What's your controlling device ?


Java3d has native support for things like
Head Mounted Displays ( HUD s ) and code has
been written for some other controller devices.

Don't re-invent the wheel, re-use pre-written,
pre-tested code: it is the pre-ferred solution.


Herbert Stocker wrote:
|
| With BS Contact VRML you can load a DLL
| directly into a Script node.
|
| To be more precisely, in the Script node you
| can specify the class ID of a COM object,
| which is located in a DLL.
|
| ( If loading COM objects from VRML
| sounds unsafe to somebody:
| BS Contact loads a DLL only if the
| DLL has registered itself
|
| with BS Contact using the registry.)
|
| You can also write an extension for the
| DeviceSensor node, which is a Sensor node
| for arbitrary input and output devices.
|
| Herbert
| Herbert Stocker www.bitmanagement.de
|

Well, using DLLs implies using Microsoft Windows
and using Microsoft Windows sounds unsafe. ;^)

VRML Scripts are limiting and inferior to Java.

The old-style VRML plug-ins are less portable,
less safe, less capable in many important respects,
and less desirable.

Look at the Nasa WITS program: it uses Java3d & VRML.

Nasa evaluated and compared Java3d & the old plug-ins

Java3d was chosen because
----------------- it was the better tool for the task.


Nasa's Patti Koenig writes about using Java3d & VRML:
|
| You can check out FastScript3D which
| runs entirely in a browser and provides
| JavaScript extensions to Java3D.
|
| You can load static ___ vrml ___
| components into FastScript3D using the vrml97
| loader [ created by Sun Microsystems Inc. ]
| and hook them up / interconnect them as
| you desire and then use a set of simple animation
| commands to articulate and manipulate your objects ....
|
http://groups.google.com/groups?th=e7470a56a6fd677e



Nasa uses Java3d & VRML for Mars Rover WITS program
---------------------------------------------------
http://www.frontiernet.net/~imaging..._animation.html


Get it: It's free. Get a clue: Use Java & Java3d.

-- Paul, Java Developer & Web Animator
--------------------------------------
Imaging the Imagined: Modeling with Math & a Keyboard

Patrick Koegel

2003-12-19, 9:45 pm

quote:

> More details please ...
>
> Java3d can animate VRML in a browser as applet,
> ----------------------------------------------
> and you can ( and I have ) controlled 3d objects
> using Java3d in an applet using a simple client /
> server connection, and you could solve your problem
> that way, using the built in networking capabilities
> of Java: just create and open a Socket and read and
> write through the pipe.
>
> This neatly divides your problem into two distinct,
> smaller ( and simpler ) problems which is a good
> programing methodology.
>
> Use your device, C interface, JNI, and create a
> simple Client / Server pair : get that working,
> then add that Client connection capability
> to your Java 3d client applet.
>
> If running it as an application ( not in a browser )
> is an option ( and desired ): it's even simpler.
>
> What's your model ?
>
> What's your controlling device ?
>
> Java3d has native support for things like
> Head Mounted Displays ( HUD s ) and code has
> been written for some other controller devices.
>
> Don't re-invent the wheel, re-use pre-written,
> pre-tested code: it is the pre-ferred solution.
>



Hi
Thanks for you advices in this way.
But the main problem about this is I'm doing this for an university project I have to do and so I have not so much
flexibility.
My device is a "Flock of Birds" from Ascension which is serial connected.
I have to use VRML and it should run under Cortona or under Cosmo Player. I'm running out of time. The code is finished
the only thing is now to get it work. And there must be a way to get this to work I don't think I'm the first one who
does this "VRML -> Java -> C" thing.

Thanks
Patrick
Joerg Scheurich aka MUFTI

2003-12-19, 9:45 pm

> I think
quote:

> the problem is that the applet has not the rights to access the file.
> If I try to sign the file as a jar file I can`t access it from VRML
> because you can only call class files with the "url" command.



I tried somewhat similar with netscape/java 1 (for cosmoplayer).
Netscape/java 1 has some security functions that would open a window
to accept class a file from a signed jar file.
This failed cause netscape did not managed to open the window from
the running browser.
The solution was to create a dummy applet, that do nearly nothing, but
calls the functions that would open a window to accept class a file from
the signed jar file.
If the signed jar is permanently accepted for in this window, the usage
of the class file of the VRML script is working in future.

You can see my try under

http://www.csv.ica.uni-stuttgart.de...etworking_java/

but i doubt, this is very useful for other browsers and java 2.
But maybe there is a similar solution for your problem.

so long
MUFTI

--
Eine oder mehrere Erinnerungen werden moeglicherweise nicht angezeigt.
(Fehlermeldung von Micro$oft outlook)
Karl von Laudermann

2003-12-19, 9:45 pm

KoegelP@gmx.de (Patrick) wrote in message news:<dba3c8da.0312180836.6f22fa1b@posting.google.com>...
quote:

> If I try to sign the file as a jar file I can`t access it from VRML
> because you can only call class files with the "url" command.



You can get a URL to a resource in a .jar file by using the
getResource(String) method of ClassLoader.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews