Thanks for the interest, Mark - I'll give a break-down in Pseudo-code,
followed by a description of what happens. If you're interested in
persuing it, I can send you the App.
Class ObjectPicker extends Behavior // This is added to the scene graph
{
public initialise(){
Wake up on next frame, or interesting mouse events;
}
public synchronized queueNodesForSelection(selectedObjects){
store the nodes for later in queuedObjectSelection;
}
public processStimulus(wakup critieria){
For each wakeup criteria{
If (it's a next frame criteria){
If (We have something queued){
setSelectedObjects(queuedObjectSelection);
empty the queue;
}
}
...
}
}
public synchronized setSelectedObjects(Vector selectedObjects)
{
For each node in the selectedObjects{
node.getAppearance.getMaterial.setDiffuseColor(Bright Red);
... Likewise for specular and ambient colours.
}
}
}
...
Class SceneExplorer extends Jtree implements TreeSelectionListener
{
...
Public valueChanged(...){
Vector selectedObjects;
for each interesting node from selected TreePaths{
add node to selectedObjects;
}
objectPicker.queueNodesForSelection(selectedObjects);
}
}
OK - a few points.
1. The method of changing the apearance's material colour works fine for
mouse rollovers and clicks etc. in the Canvas3D. It also works fine if
we only queue one object for selection from the Jtree.
2. If a multiple selection is made in the Jtree, then *some* of the
corresponding scene graph nodes' colours do not change to red in the
Canvas3D rendering (their material colour will report themselves as Red,
however).
3. There is also an OrbitBehaviour attached to the scene graph so we can
zoom, translate and rotate the view with the mouse. When the view is in
the state described in 2, the nodes which are not correctly repainted as
Red, will in some cases appear correctly for a range of view
transformations, and then appear incorrecly again outside of the range -
so by navigating around the scene with the mouse, you can make the
offending nodes' colours 'wink' in and out.
4. The problem only manifests itself *sometimes* (Although the majority
of times!).
5. By spawning another Thread from the Jtree.valueChanged method, and
queuing the nodes for selection one at a time, with a pause in-between,
the problem seems to go away. It's almost as if the scene needs to
render at least one frame in between the colour changes for it to work
reliably.
PLEASE HELP!!
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Hood
Sent: 15 July 2003 03:29
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Changes of material not being displayed at
java1.3.1
> Date: Sat, 12 Jul 2003 11:29:51 +0100
> From: Lewis Walker <[EMAIL PROTECTED]>
> Organization: Rhema Designs
>
> > We haven't seen this problem. There have been a lot of bug fixes
> > from Java 3D 1.3 to 1.3.1; you may want to try upgrading to see if
> > the problem is still there in 1.3.1.
>
> Actually, it is 1.3.1 that I'm using.
OK, I've changed the subject line.
> > Where are you performing the call? Attribute changes won't
> > necessarily be synchronized with rendering unless they are performed
> > from the Behavior thread.
>
> I tried this.
Let's try factoring out the synchronization issues for the moment then.
Looking more closely over some of your previous points, is it the
situation that you've updated the Appearances for two or more Shape3D,
and then a few frames later you're updating the view dynamically, and
the shapes flash their appearances without any other updates?
That would definitely be a bug in J3D 1.3.1, but we'll need a
reproducible test case to investigate.
-- Mark Hood
========================================================================
===
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".
===========================================================================
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".