Skip to main content

Geometry in Wrong Place after Locale Change

2 replies [Last post]
Joined: 2004-06-25


back on Oct 10 I posted "Hires Coordinate Locale bug?"
and received no replies.
If one of the Java3D developers could reply, I would
greatly appreciate it.
This bug is holding up an otherwise nearly completed product:
When I switch between two hires coord Locales,
some of the geometry is not in the correct position.
Is there an extra step I'm missing?
Could someone please post an example of switching between
As a workaround, I call the setTransform() for each of the
relevant nodes in the graph.
This workaround works, but introduces a secondary bug.
I occasionally get the dreaded intermittent:

java.lang.NullPointerException at

I thought the above problem might have something to do with known bug ID: 4774341. So I added the following workaround, which is documented in the bug parade:

try{Thread.sleep(200);}catch(Exception ex)

Which works 90% of the time. But I need a solution
that works 100% of the time.

Could someone at JavaSoft please reply to my problem?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-03-17


Do you have a test program that demonstrates the problems you are seeing? If you could please file an issue and attach a simple test program, that would be helpful. See the following thread for more information on how to do that.

I do have a couple of questions for you. When you say "switch between two hires coord Locales", what exactly do you mean? Do you: A) detach all BranchGroups (including the view branch) from the first Locale and reattach it to a second Locale? B) detach the ViewPlatform in the first Locale from the View and attach the second ViewPlatform in the second Locale to the View? or C) something else?

-- Kevin

Joined: 2004-06-25

I don't have a test program and it will take some time to
pare my code down to a test version. I'll create one
when I finish my remaing non-j3d related code.

In the mean time, here is how I switch my view between locales:
class UniverseMultiLocaleMars extends SimpleUniverse{
// contains three Locale classes, each with their own
// HiResCoord classes

class PointOfViewLocale {
// container class for View related classes.
// One PointOfViewLocale class is created for each
// Locale class in UniverseMultiLocaleMars.
ViewingPlatform viewingPlatform;
ViewPlatform viewPlatform;

class Main3DViewJPanel extends JPanel {
Canvas3D canvas3D;

// Main program code snippet
Viewer viewerMine = new Viewer(main3DViewJPanel.canvas3D);
View viewerView = viewerMine.getView();
UniverseMultiLocaleMars universeMultiLocaleMars = new
pointOfViewLocaleCurrent.viewPlatform); // constructor passes these arguments to the parent class using super();
// Function used to switch view between locales:
void switchToLocaleView(PointOfViewLocale pointOfViewLocale){
if (pointOfViewLocaleCurrent.viewPlatform != null)
// Where pointOfViewLocaleCurrent is switched between three PointofViewLocale classes.

Do you have an example of the "correct" way to do this?
I've searched online and couldn't find any view switching
examples. Java3D book doesn't have one either.