PickTool.pickAllSorted() returns null when enabling on-screen rendering

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

PickTool.pickAllSorted() returns null when enabling on-screen rendering

Schorsch
Hi there,

I use a SimpleUniverse with the PickTool from the package com.sun.j3d.utils.picking (and not from pickfast).

If I create the universe with an off-screen Canvas3D, then PickTool.pickAllSorted() returns a proper list of PickResult. However, if I create the universe with an on-screen Canvas3D, then PickTool.pickAllSorted() returns just null.

Can anybody tell me what the problem is here? See the two relevant source files attached.
VirtualMeasurementUniverse.java
Measurement3D.java

Note, that the pickable objects are added to the scene by means of the method Measurement3D.addMeasurementObject(BranchGroup p_oMeasurementObject) where p_oMeasurementObject has the following flags:
        a_oMeasurementObject.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
        a_oMeasurementObject.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
        a_oMeasurementObject.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
        a_oMeasurementObject.setCapability(BranchGroup.ALLOW_DETACH);

Thanks a lot in advance,
Schorsch

Reply | Threaded
Open this post in threaded view
|

Re: PickTool.pickAllSorted() returns null when enabling on-screen rendering

gouessej
Administrator
Hi

Please provide a rudimentary test case instead of a few "relevant" classes or reproduce your bug on an existing example. It would help to determine whether it comes from your code.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PickTool.pickAllSorted() returns null when enabling on-screen rendering

Schorsch
Okay, thanks. I will do that. I just thought it might be a stupid little thing that one can see straight a way in my provided short configuration files.
I will write and upload a quick test.
Reply | Threaded
Open this post in threaded view
|

Re: PickTool.pickAllSorted() returns null when enabling on-screen rendering

Schorsch
Here we go:
PickToolTest.java

This should be simple enough. Just run it and change the flag IS_OFFSCREEN from true to false and voilĂ .

--------------------------------------------------------
edit: Removed wrong dependencies in the sample file. Accidental typo. The sample file should execute now.
Reply | Threaded
Open this post in threaded view
|

Re: PickTool.pickAllSorted() returns null when enabling on-screen rendering

gouessej
Administrator
Thanks.

@Harvey We need your help, we need to invoke the Java3D God :D

What happens when you use an onscreen canvas without adding it into the content pane?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PickTool.pickAllSorted() returns null when enabling on-screen rendering

Schorsch
gouessej wrote
What happens when you use an onscreen canvas without adding it into the content pane?
Adding it to the AWT Frame / Swing content pane or not, doesn't make a difference. As soon as the offscreen-parameter in the constructor of the Canvas3D class is set to false, the PickTool returns null.