This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > March 2004 > Navigation of VRML world through Java?
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 |
Navigation of VRML world through Java?
|
|
|
| Hi,
I'm doing a university project of our campus modelling it in VRML.
The user will be given guided tours to where they want to go,
from clicking a Java applet button which should navigate the world
automatically
i.e. "no user interaction" with the world itself, only through the
java applet.
All i want to know is it possible to navigate a vrml world using java
scripts
or a Java applet/GUI with EAI or the like?
I have done a lot of research and have still not got really
anywhere, I thought I may have been able to something by creating
multiple
viewpoint nodes one after another and use this as a route but I have
not been
able to switch viewpoints via the script.
I also thought an interpolator of some
sort may have been the way to go but from what I can gather they only
seem to
change position of other things and not the users position.
Also perhaps does anyone know if it would be easier to use Java3d and
load the vrml file into it or would Java applet with EAI be easier to
do?
I tryed many Java EAI integrated vrml web pages, but keep gettin
errors, as the embedded java applets do not load with either 1: using
Java Suns Plugin or 2:Microsoft Virtual Java Machine.
Any help at all greatly appreciated, im really stuck....thanks.
| |
| Jeremy Pitten 2004-03-07, 6:28 pm |
| Javascripts are fine for scene navigation.
Here is an example using interpolators to move through a set of pre-defined
viewpoints, it enables you to control the speed and path through the scene
which you can't get if you just jump between viewpoints.
You could control this sort of PROTO node using the Java EAI but using eai
introduces all sorts of problems as you have already found, probably better
to use a touch sensor to a start tour or a head-up-display.
Your problems with the EAI may be because most of the popular commercial
vrml plugins are reliant on the MS JVM, they won't work with the sun jvms so
you're stuck with MS JVM which is obsolete. There are vrml plugins that can
be used with the sun jvm, it depends whether or not you will have control
over how your audience accesses your vrml content.
#VRML V2.0 utf8
# GUIDED TOUR OF SCENE
# ------------------------
# identity - tour name.
# key - a set of key values, one per position/orientation
# enables us to weight the time taken to move between
# viewpoints.
# position - a set of key positions on the tour.
# orientation - a corresponding set of orientations, the orientation
# of the view at each key position on the tour.
# duration - the duration of the tour in seconds.
# start - if TRUE the tour is started or restarted, if FALSE the
# tour is paused.
# loop - the tour is played continuously if TRUE.
# position - the tour generates a notification when each key position
# on the tour is reached.
#
PROTO MTour [ exposedField SFString identity ""
exposedField MFFloat key []
exposedField MFVec3f position []
exposedField MFRotation orientation []
exposedField SFTime duration 30
exposedField SFBool loop FALSE
exposedField SFBool start TRUE
eventOut SFVec3f currentPosition ] {
DEF GUIDE Viewpoint { jump TRUE }
DEF PI PositionInterpolator {
key IS key
keyValue IS position
}
DEF RI OrientationInterpolator {
key IS key
keyValue IS orientation
}
DEF TS TimeSensor {
enabled IS start
loop IS loop
cycleInterval IS duration
}
DEF SC Script {
field SFNode time USE TS
field SFNode proximity USE PI
eventIn SFVec3f currentPosition
eventOut SFVec3f position IS currentPosition
url "java script:
function initialize() {
print('MTour : initialize() ');
if(proximity.key.length == 0){
time.enabled = false;
}
}
function currentPosition(value){
for(i=0; i < proximity.key.length; i++){
if(proximity.keyValue[i].subtract(value).length() == 0){
position = value;
}
}
}"
}
ROUTE TS.isActive TO GUIDE.set_bind
ROUTE TS.fraction_changed TO PI.set_fraction
ROUTE TS.fraction_changed TO RI.set_fraction
ROUTE PI.value_changed TO GUIDE.set_position
ROUTE RI.value_changed TO GUIDE.set_orientation
ROUTE PI.value_changed TO SC.currentPosition
}
Transform {
children [
Shape { appearance Appearance { material Material { diffuseColor 0.8 0.6
0.4 } } geometry Box {size 1 1 1} }
]
}
DEF TOUR MTour { key [0, 0.2, 0.4, 0.6, 0.8, 1]
position [ 0 0 3, 3 0 1, 5 2 0, 2 0 -3, 1 -1 -1, 0 0 3 ]
orientation [ 0 1 0 0, 0 1 0 0.57, 0 1 0 1.5, 0 1 0 -0.57, 0 1 .2 1, 0 1
0 0 ]
loop TRUE
duration 20
}
--------------end of file
"Gerry" <gerard.morley2@mail.dcu.ie> wrote in message
news:10aeb23e.0403071016.df11537@posting.google.com...
> Hi,
>
> I'm doing a university project of our campus modelling it in VRML.
> The user will be given guided tours to where they want to go,
> from clicking a Java applet button which should navigate the world
> automatically
> i.e. "no user interaction" with the world itself, only through the
> java applet.
>
> All i want to know is it possible to navigate a vrml world using java
> scripts
> or a Java applet/GUI with EAI or the like?
>
> I have done a lot of research and have still not got really
> anywhere, I thought I may have been able to something by creating
> multiple
> viewpoint nodes one after another and use this as a route but I have
> not been
> able to switch viewpoints via the script.
>
> I also thought an interpolator of some
> sort may have been the way to go but from what I can gather they only
> seem to
> change position of other things and not the users position.
>
> Also perhaps does anyone know if it would be easier to use Java3d and
> load the vrml file into it or would Java applet with EAI be easier to
> do?
> I tryed many Java EAI integrated vrml web pages, but keep gettin
> errors, as the embedded java applets do not load with either 1: using
> Java Suns Plugin or 2:Microsoft Virtual Java Machine.
>
>
> Any help at all greatly appreciated, im really stuck....thanks.
| |
| Mirek Borsky 2004-03-12, 5:29 am |
| > Your problems with the EAI may be because most of the popular commercial
> vrml plugins are reliant on the MS JVM, they won't work with the sun jvms so
> you're stuck with MS JVM which is obsolete. There are vrml plugins that can
> be used with the sun jvm, it depends whether or not you will have control
> over how your audience accesses your vrml content.
Hello,
may I ask, which VRML plugins can be used with the sun jvm ?
Thanks
| |
| Joerg Scheurich aka MUFTI 2004-03-12, 7:29 am |
| > I also thought an interpolator of some
> sort may have been the way to go but from what I can gather they only
> seem to
> change position of other things and not the users position.
You can try the script white_dune-0.27beta80/tools/collectViewpoints.awk
which is part of the white_dune source archive
http://www.csv.ica.uni-stuttgart.de...27beta80.tar.gz
If you have a vrmlfile only with viewpoints with are not moved/rotated/scaled
etc. by Transform nodes, you should install the gawk program (e.g. part
of cygwin) load the VRML world with white_dune, save it to input.wrl and
then run in the commandline
gawk -f SOMEPATH/collectViewpoints.awk inputfile.wrl > outputfile.wrl
You can import the resulting file into your VRML file, e.g. with
"File -> Import" in white_dune.
To jump to a viewpoint you need to send a "set_bind" event to the viewpoint.
so long
MUFTI
--
A number of the Windows-based application programming interfaces (APIs) that
are documented as accepting only a module handle are defined incorrectly.
(aus einer M$Windows Dokumentation)
| |
| R. Russell Kinter 2004-03-12, 10:29 pm |
| mirek.borsky@post.cz (Mirek Borsky) wrote in message news:<5bd4033.0403120040.6e8d5651@posting.google.com>...
>
> Hello,
> may I ask, which VRML plugins can be used with the sun jvm ?
>
> Thanks
hi mirek,
I think the sentence "There are vrml plugins that can be used with the
sun jvm,"
is missing the word "no" and the poster made a typo. Netscape 4*
series java
will also work with VRML plugin EAI classes ( downloadable and free at
the Netscape archives :), if the MSJVM is not available.
| |
| Jeremy Pitten 2004-03-13, 10:29 am |
| No, not a typo.
What about :
Xj3D
OpenVrml
FreeWRL
"R. Russell Kinter" <Pyth7@comcast.net> wrote in message
news:1a90d129.0403121815.72e575de@posting.google.com...
> mirek.borsky@post.cz (Mirek Borsky) wrote in message
news:<5bd4033.0403120040.6e8d5651@posting.google.com>...
commercial[color=darkred]
jvms so[color=darkred]
that can[color=darkred]
control[color=darkred]
> hi mirek,
> I think the sentence "There are vrml plugins that can be used with the
> sun jvm,"
> is missing the word "no" and the poster made a typo. Netscape 4*
> series java
> will also work with VRML plugin EAI classes ( downloadable and free at
> the Netscape archives :), if the MSJVM is not available.
| |
| R. Russell Kinter 2004-03-14, 4:28 am |
| Hi Jeremy,
Ok, point taken. Sorry for my own "typo"
Actually, I was wondering which JVM FreeWRL used
for the V-net screen shots at the FreeWRL site.
I have to say though, Xj3D seems next to useless
as a VRML browser, on my system anyway.
and I need MS's c++ runtime to compile openVRML's LookAt?
"Jeremy Pitten" <jpitten@btinternet.com> wrote in message news:<c2v4hd$qkh$1@hercules.btinternet.com>...[color=darkred]
> No, not a typo.
>
> What about :
>
> Xj3D
> OpenVrml
> FreeWRL
>
>
> "R. Russell Kinter" <Pyth7@comcast.net> wrote in message
> news:1a90d129.0403121815.72e575de@posting.google.com...
> news:<5bd4033.0403120040.6e8d5651@posting.google.com>...
> commercial
> jvms so
> that can
> control
| |
| Jeremy Pitten 2004-03-14, 2:29 pm |
| Must admit I don't use any of these browsers, I gave up waiting for a spec
compliant plugin that would work with a sun jvm nearly 2 years ago, ended up
building my own vrml browser based on Java3d. Because my scenes are built
from a small set of proto nodes this was fairly straight forward.
"R. Russell Kinter" <Pyth7@comcast.net> wrote in message
news:1a90d129.0403132344.308a46b5@posting.google.com...
> Hi Jeremy,
> Ok, point taken. Sorry for my own "typo"
> Actually, I was wondering which JVM FreeWRL used
> for the V-net screen shots at the FreeWRL site.
> I have to say though, Xj3D seems next to useless
> as a VRML browser, on my system anyway.
> and I need MS's c++ runtime to compile openVRML's LookAt?
>
> "Jeremy Pitten" <jpitten@btinternet.com> wrote in message
news:<c2v4hd$qkh$1@hercules.btinternet.com>...[color=darkred]
sun[color=darkred]
plugins[color=darkred]
| |
| Mirek Borsky 2004-03-15, 4:30 pm |
| > What about :
>
> Xj3D
> OpenVrml
> FreeWRL
Well, I need to run it in Windows, so I can't use FreeWRL. I tried to
run OpenVRML, but I was not able to get rid of error messages when
trying their browser.
I am using Xj3D now. But there are so many things not working... And
some of them are marked as COMPLETE on their site...
And I am not able to subscribe to their SOURCE discussion list to
discuss with them...
Oh, I hope they will finish their website transformation soon.
| |
| Joerg Scheurich aka MUFTI 2004-03-16, 7:30 am |
|
> And I am not able to subscribe to their SOURCE discussion list to
> discuss with them...
Not able technical or just not able of "no time, can not afford" ?
so long
MUFTI
--
acpi_tz0: WARNING: current temperatur (163911.6C) exceeds
system limits.
FreeBSD Kernelmeldung
| |
| Mirek Borsky 2004-03-16, 12:30 pm |
| > > And I am not able to subscribe to their SOURCE discussion list to
>
> Not able technical or just not able of "no time, can not afford" ?
>
Oh, their Majordomo told me, that my request has been forwarded to the
owner of the "source" list for approval. It was four days ago. Maybe I
am just too impatient.
Mirek
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|