Hi all:
I am using Java3D in an application used for 3D training. The application
uses VRML worlds for its 3D data. We have a VRML loader/browser which loads
and manipulates the world. The application has 3 modes. In each mode a
separate VRML world is loaded (after unloading the old VRML world). So at a
time there is only one VRML world loaded.
Every time a vrml world is loaded, we attach a customized Behavior node
(CustomBehavior) to the world, which helps users to navigate around. Other
than navigation, it also assists in notifying when user touches a
TouchSensor or performs other activities.
The problem that I have happens only when an old VRML world is unloaded and
the new one is loaded
Lets say the User changed mode from Mode A to Mode B
1. The application unloads the VRML World 1 related to Mode A. We make sure
that the world is properly unloaded. We called
VirtualUniverse.removeAllLocales and made sure all other references related
to the World 1 are gone. I run the application using OptimizeIt and found
that in deed all necessary memory was freed up and unloading was happening
properly. So no problem so far.
2. The world then loads up VRML World 2 related to mode B. I can see the
world. However I can not move around or click on any TouchSensor.
After further investigation, I found out the reason. I saw that the class
CustomBehvaior which is responsible for navigation etc, is not receiving and
processStimulus method from Java3D scheduler. As a result, nothing was
happening.
I also noticed that when I manually minimize (iconify) the application's
JFrame (by clicking on Frame's minimize icon) and maximize it again,
everything becomes OK. In other words, the processStimulus method of the
CustomBehavior class starts getting call from Java 3D scheduler as and when
user presses / drags mouse on the Canvas3D.
I would like to know if there is any solution to this problem. I tried
stopping and starting the renderer after the second world is loaded. That
didn�t work. I invalidated and validated the parent Frame (as well as
Canvas3D) after the second world is loaded. That didnt work too. I tried
repainting everything, that didn't work as well.
I am wondering what happens in the Java3D renderer when I manually minimize
and maximize the parent Frame. Because whatever it is, that apparently fixes
my problem.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".