This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > January 2004 > Browser.loadURL / Applet.showDocument bug





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 Browser.loadURL / Applet.showDocument bug
muaddib

2004-01-05, 2:30 pm

Greetings again,

I am having difficulties with loadURL and showDocument methods
using Java EAI. Unfortunately, the scenario is too complicated to
produce example source files, but this is the situation. I have
essentially a Collision detector which, when activated, invokes one of
the above two methods to load a new world. Typically a user is moving
through the collision area when it is activated, which means that as the
new world is loading, they are still holding down the mouse button. At
least in Blaxxun 5.1, when the new world loads up, the browser has "a
problem". :) It hasn't frozen, instead, the browser ignores all input
from the mouse. The problem is fixed by clicking on another window, and
then moving the mouse back to the browser.

Has anyone seen this error in other browsers? Knows a good
workaround? I have created a way to wait for the user to depress the
mouse button before loading the next world, but would like something better.

Muaddib






--
-------------------------------------------------------
VRSpace - An open source, 3D, modular, cross-platform,
multi-user system with persistent shared objects.
Check out a demo at http://www.vrspace.org/demo.htm
-------------------------------------------------------

Bill Angel

2004-01-06, 10:29 am

Hi:

The following code shows how to use a ProximitySensor to detect when
the viewer has "collided" with an object (a Box). Upon detecting the
collision, the Script code adds an alternative world to the scene, and
then switches to displaying that world. Perhaps this approach will
work better than the one that you are currently attempting to utilize.

#VRML V2.0 utf8

Collision {
collide FALSE
children
DEF SWITCH Switch {
choice [
DEF LEVEL0-GROUP Group {
children [
DEF PROXIMITY-SENSOR-LOD-LEVEL0 ProximitySensor {
center 0 0 0
size 10 10 10
}
Box { size 10 10 10 }
]
}
DEF LEVEL1-GROUP Group {}
]

}
}

DEF SCRIPT Script {
field SFNode lodLevel1Group USE LEVEL1-GROUP
field SFString level1URL "sphere.wrl"
field SFNode mySwitch USE SWITCH
eventIn SFBool proximitySensor_isActive
eventIn MFNode nodesAdded
directOutput TRUE
url [
"java script:
function initialize () {
mySwitch.set_whichChoice = 0;
}
function proximitySensor_isActive(value) {
if(value == true) {
Browser.createVrmlFromURL(level1URL,lodLevel1Group,'addChildren');
print('nodes created'); // for debugging
}
}
function nodesAdded(value) {
if(value.length > 0) {
mySwitch.set_whichChoice = 1;
print('nodes added to scene'); // for debugging
}
}
"
]
}

ROUTE PROXIMITY-SENSOR-LOD-LEVEL0.isActive TO
SCRIPT.proximitySensor_isActive
ROUTE LEVEL1-GROUP.children_changed TO SCRIPT.nodesAdded


<end of code>

In this example, the file "sphere.wrl" contains the following
statements

#VRML V2.0 utf8
Sphere { radius 1 }


--- Bill Angel




muaddib <robmeyers@hotmail.com> wrote in message news:<3FF9A8BE.2000407@hotmail.com>...
quote:

> Greetings again,
>
> I am having difficulties with loadURL and showDocument methods
> using Java EAI. Unfortunately, the scenario is too complicated to
> produce example source files, but this is the situation. I have
> essentially a Collision detector which, when activated, invokes one of
> the above two methods to load a new world. Typically a user is moving
> through the collision area when it is activated, which means that as the
> new world is loading, they are still holding down the mouse button. At
> least in Blaxxun 5.1, when the new world loads up, the browser has "a
> problem". :) It hasn't frozen, instead, the browser ignores all input
> from the mouse. The problem is fixed by clicking on another window, and
> then moving the mouse back to the browser.
>
> Has anyone seen this error in other browsers? Knows a good
> workaround? I have created a way to wait for the user to depress the
> mouse button before loading the next world, but would like something better.
>
> Muaddib


Sponsored Links


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