Mac Canvas3D location bug

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

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
On 10/06/2013 08:16 PM, Manu [via jogamp] wrote:
> If fixing this bug will take a lot of time, I can find a workaround in the
> meantime without breaking everything in my program, because I can also set
> directly the visibility of the 3D canvases when they should appear/disappear.

Sure, do as it pleases you, np.

I am working on it now and will kick of a build later tonight.

Still would appreciate your testing as usual. Thank you.

~Sven


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
In reply to this post by Manu
On 10/06/2013 08:18 PM, Sven Gothel wrote:
> On 10/06/2013 08:16 PM, Manu [via jogamp] wrote:
>> If fixing this bug will take a lot of time, I can find a workaround in the
>> meantime without breaking everything in my program, because I can also set
>> directly the visibility of the 3D canvases when they should appear/disappear.
>
> Sure, do as it pleases you, np.
>
> I am working on it now and will kick of a build later tonight.

<https://jogamp.org/bugzilla/show_bug.cgi?id=849>
<https://jogamp.org/bugzilla/show_bug.cgi?id=729>
<http://jogamp.org/git/?p=jogl.git;a=commit;h=e33e6374e0be0454f7e9732b5f897f84dbc3c4dc>

.. build in progress .. but having dinner,
i.e. aggregating later (~2 hours).

You may pick up the individual build if time is pressing
or build yourself.

~Sven




signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
In reply to this post by Manu
On 10/06/2013 09:32 PM, Sven Gothel wrote:

> On 10/06/2013 08:18 PM, Sven Gothel wrote:
>> On 10/06/2013 08:16 PM, Manu [via jogamp] wrote:
>>> If fixing this bug will take a lot of time, I can find a workaround in the
>>> meantime without breaking everything in my program, because I can also set
>>> directly the visibility of the 3D canvases when they should appear/disappear.
>>
>> Sure, do as it pleases you, np.
>>
>> I am working on it now and will kick of a build later tonight.
>
> <https://jogamp.org/bugzilla/show_bug.cgi?id=849>
> <https://jogamp.org/bugzilla/show_bug.cgi?id=729>
> <http://jogamp.org/git/?p=jogl.git;a=commit;h=e33e6374e0be0454f7e9732b5f897f84dbc3c4dc>
>
> .. build in progress .. but having dinner,
> i.e. aggregating later (~2 hours).
http://jogamp.org/deployment/archive/master/gluegen_726-joal_484-jogl_1104-jocl_856/

~Sven


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
Great! I think this one is the good one for Sweet Home 3D.
You can test Java 3D 1.6.0pre8 / GlueGen build 726 / JOGL build 1104 under Mac OS X and Java 6/7 with Sweet Home 3D 4.2 beta thanks to this Java Web Start link.
I also successfully tested this combination in applets on my side, and noticed that some issues that happened in multiple screen aren't here anymore.
The right location of the 3D canvas is shown with the 3D view displayed at the bottom right of Sweet Home 3D main screen, and the fix for 3D canvases visibility was necessary for the 4 screens shown in the import furniture wizard launched with the Furniture > Import furniture... menu item.

Sweet Home 3D has some problems under Java Web Start with Java 6 (no drag and drop from catalog to plan, program freeze when showing About dialog...), but I don't think it's bound to Java 3D 1.6 or JOGL 2, since it happens with Java 3D 1.5.2 too. Hope Apple will update their Java 6 sooner or later.

Thanks again for your efforts.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

gouessej
Administrator
Don't expect any update of Apple's JRE. I just hope that Swing and AWT are going to be correctly supported under Mac OS X with OpenJDK and Oracle Java.

I'm glad to see Sweet Home 3D working reliably under Mac with the latest version of Java3D :D
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
gouessej wrote
Don't expect any update of Apple's JRE.
I don't have big expectations about this too.
But the regressions I noticed happen only with Java Web Start 6, so users using Java 6 can still run Sweet Home 3D with its .app bundle or executable jar versions. I just prevented the application to run with Java Web Start 6 to avoid receiving useless support requests in that environment.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
Sorry, I spoke a little too fast about applets. Moving a 3D canvas in an applet doesn't work all the time.
When you try to move horizontally the canvas 3D with the splitter of the following example, its location isn't always correct.

import java.awt.GraphicsEnvironment;
import javax.media.j3d.*;
import javax.swing.*;
import com.sun.j3d.utils.universe.SimpleUniverse;

public class Canvas3DPositionTest extends JApplet {
  public void init() {
    // Create a new canvas 3D
    GraphicsConfigTemplate3D gc = new GraphicsConfigTemplate3D();
    Canvas3D canvas = new Canvas3D(GraphicsEnvironment.getLocalGraphicsEnvironment().
        getDefaultScreenDevice().getBestConfiguration(gc));
    new SimpleUniverse(canvas);

    // Build a GUI where the canvas 3D is located at bottom right of the frame 
    // and can be resized with split panes dividers
    JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
        true, new JScrollPane(), canvas);    
    verticalSplitPane.setResizeWeight(0.5);
    JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
        true, new JScrollPane(), verticalSplitPane);
    horizontalSplitPane.setResizeWeight(0.5);
    JRootPane intermediateRootPane = new JRootPane();
    intermediateRootPane.setContentPane(horizontalSplitPane);
    add(intermediateRootPane);
  }
}

Be sure to test under Java 6 and 7 because the applet doesn't behave the same in a browser.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
On 10/07/2013 04:26 PM, Manu [via jogamp] wrote:

> Sorry, I spoke a little too fast about applets. Moving a 3D canvas in an
> applet doesn't work all the time.
> When you try to move horizontally the canvas 3D with the splitter of the
> following example, its location isn't always correct.
>
> import java.awt.GraphicsEnvironment;
> import javax.media.j3d.*;
> import javax.swing.*;
> import com.sun.j3d.utils.universe.SimpleUniverse;
>
> public class Canvas3DPositionTest extends JApplet {
>   public void init() {
>     // Create a new canvas 3D
>     GraphicsConfigTemplate3D gc = new GraphicsConfigTemplate3D();
>     Canvas3D canvas = new Canvas3D(GraphicsEnvironment.getLocalGraphicsEnvironment().
>         getDefaultScreenDevice().getBestConfiguration(gc));
>     new SimpleUniverse(canvas);
>
>     // Build a GUI where the canvas 3D is located at top right of the frame
>     // and can be resized with split panes dividers
>     JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
>         true, new JScrollPane(), canvas);    
>     verticalSplitPane.setResizeWeight(0.5);
>     JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
>         true, new JScrollPane(), verticalSplitPane);
>     horizontalSplitPane.setResizeWeight(0.5);
>     JRootPane intermediateRootPane = new JRootPane();
>     intermediateRootPane.setContentPane(horizontalSplitPane);
>     add(intermediateRootPane);
>   }
> }
>
Can you please reference the now existing unit tests ? Thank you!

>
> Be sure to test under Java 6 and 7 because the applet doesn't behave the same
> in a browser.

Don't know how to test applets w/ java6 in a browser when java7 is installed.

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
In reply to this post by Manu
On 10/07/2013 04:30 PM, Sven Gothel wrote:
>
> Can you please reference the now existing unit tests ? Thank you!
And create a new one w/ as an Applet use case maybe ..
This saves my time quite a bit.




signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
Sorry I mixed class names. Here's a better applet test case.
import java.awt.GraphicsEnvironment;
import javax.media.j3d.*;
import javax.swing.*;
import com.sun.j3d.utils.universe.SimpleUniverse;

public class Canvas3DPositionAppletTest extends JApplet {
  public void init() {
    // Create a new canvas 3D
    GraphicsConfigTemplate3D gc = new GraphicsConfigTemplate3D();
    Canvas3D canvas = new Canvas3D(GraphicsEnvironment.getLocalGraphicsEnvironment().
        getDefaultScreenDevice().getBestConfiguration(gc));
    new SimpleUniverse(canvas);

    // Build a GUI where the canvas 3D is located at top right of the frame 
    // and can be resized with split panes dividers
    JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
        true, new JScrollPane(), canvas);
    horizontalSplitPane.setResizeWeight(0.5);
    JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
        true, horizontalSplitPane, new JScrollPane());    
    verticalSplitPane.setResizeWeight(0.5);
    JRootPane intermediateRootPane = new JRootPane();
    intermediateRootPane.setContentPane(verticalSplitPane);
    add(intermediateRootPane);
  }
}
It already bugs with Java 6 appletviewer run from the Eclipse IDE, so no need of an accompanying HTML file I guess.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
On 10/07/2013 04:49 PM, Manu [via jogamp] wrote:

> Sorry I mixed class names. Here's a better applet test case.
>
> import java.awt.GraphicsEnvironment;
> import javax.media.j3d.*;
> import javax.swing.*;
> import com.sun.j3d.utils.universe.SimpleUniverse;
>
> public class Canvas3DPositionAppletTest extends JApplet {
>   public void init() {
>     // Create a new canvas 3D
>     GraphicsConfigTemplate3D gc = new GraphicsConfigTemplate3D();
>     Canvas3D canvas = new Canvas3D(GraphicsEnvironment.getLocalGraphicsEnvironment().
>         getDefaultScreenDevice().getBestConfiguration(gc));
>     new SimpleUniverse(canvas);
>
>     // Build a GUI where the canvas 3D is located at top right of the frame
>     // and can be resized with split panes dividers
>     JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
>         true, new JScrollPane(), canvas);
>     horizontalSplitPane.setResizeWeight(0.5);
>     JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
>         true, horizontalSplitPane, new JScrollPane());    
>     verticalSplitPane.setResizeWeight(0.5);
>     JRootPane intermediateRootPane = new JRootPane();
>     intermediateRootPane.setContentPane(verticalSplitPane);
>     add(intermediateRootPane);
>   }
> }
And this is similar w/ which unit test I have added
using your boiler plate ?

> Canvas3DPositionTest -> TestBug816OSXCALayerPos02AWT
this one ?

> Canvas3DVisibilityTest -> TestBug816OSXCALayerPos03AWT
> Canvas3DPositionInDialogTest -> TestBug816OSXCALayerPos04aAWT and TestBug816OSXCALayerPos04bAWT

By now, you might have noticed that the unit tests do not use Java3D,
so I would appreciate if you can use the existing unit tests
and modify them to your needs. This will help both of us to be sure
we test the same thing!

You can still post them here as attachments .. raw or as a git-patch.
A git pull request is also welcome ofc.

>
> It already bugs with Java 6 appletviewer run from the Eclipse IDE, so no need
> of an accompanying HTML file I guess.

I never tried testing w/ Eclipse. But if commandline appletviewer is sufficient .. good.

BTW .. the HW/LW split pane sliding issue might be non-fixable
due to HW/LW mixing .. we have other unit tests for this already
w/ 'Split' in the name AFAIK.

Does it work well on other platforms ? X11, Windows .. ?

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
> And this is similar w/ which unit test I have added
> using your boiler plate ?
>
> Canvas3DPositionTest -> TestBug816OSXCALayerPos02AWT
> this one ?

Yes, except it's an applet and the root component of the applet seems to influence the location of the 3D canvas.
Please follow these instructions to test applets with Java 6 in a browser under Mac OS X.

> By now, you might have noticed that the unit tests do not use Java3D,
> so I would appreciate if you can use the existing unit tests
> and modify them to your needs. This will help both of us to be sure
> we test the same thing!

Not sure that you can integrate this test in your unit tests, because it requires to be run from a browser to fail under Java 7.
And sorry, I don't know git yet (or so little).


> BTW .. the HW/LW split pane sliding issue might be non-fixable
> due to HW/LW mixing .. we have other unit tests for this already
> w/ 'Split' in the name AFAIK.

I don't think it's not a problem here. Just probably the root component of an applet is a different case.


> Does it work well on other platforms ? X11, Windows .. ?

I still use Java 3D 1.6 / JOGL 2 only under Mac OS X, because it's the only system where Java 1.5.2 can't run with Java 7 and I had some problems to run Java 3D 1.6 / JOGL 2 under Linux and Windows last year. I just tried again and Sweet Home 3D still fails under Windows but runs correctly under Ubuntu 12.04 with Java 7.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Sven Gothel
Administrator
On 10/07/2013 06:54 PM, Manu [via jogamp] wrote:

>> And this is similar w/ which unit test I have added
>> using your boiler plate ?
>>
>> Canvas3DPositionTest -> TestBug816OSXCALayerPos02AWT
>> this one ?
>
> Yes, except it's an applet and the root component of the applet seems to
> influence the location of the 3D canvas.
> Please follow these instructions <http://support.apple.com/kb/HT5559> to test
> applets with Java 6 in a browser under Mac OS X.
Thx.

>
>> By now, you might have noticed that the unit tests do not use Java3D,
>> so I would appreciate if you can use the existing unit tests
>> and modify them to your needs. This will help both of us to be sure
>> we test the same thing!
>
> Not sure that you can integrate this test in your unit tests, because it
> requires to be run from a browser to fail under Java 7.

We have demo applets in the unit tests trees,
i.e. the one from the applet test side.
Even though they don't expose junit functionality,
it's good to have them maintained.

> And sorry, I don't know git yet (or so little).

Raw sources using a variation of our demos/tests
would be fine as well - less work, same validation.

>
>
>> BTW .. the HW/LW split pane sliding issue might be non-fixable
>> due to HW/LW mixing .. we have other unit tests for this already
>> w/ 'Split' in the name AFAIK.
>
> I don't think it's not a problem here. Just probably the root component of an
> applet is a different case.

I will verify this later.

>
>
>> Does it work well on other platforms ? X11, Windows .. ?
>
> I still use Java 3D 1.6 / JOGL 2 only under Mac OS X, because it's the only
> system where Java 1.5.2 can't run with Java 7 and I had some problems to run
> Java 3D 1.6 / JOGL 2 under Linux and Windows last year. I just tried again and
> Sweet Home 3D still fails under Windows but runs correctly under Ubuntu 12.04
> with Java 7.

Would be good to know whether this is a JOGL issue under Windows.

In case it's a Java3D issue, Harvey might be interested.

For sure .. it should work on all platforms equally,
where OSX is the hardest, as usual.

Windows or X11 should not be an issue, sure .. driver problems may exist.

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

hharrison
In reply to this post by Manu
>> Does it work well on other platforms ? X11, Windows .. ?
>
>I still use Java 3D 1.6 / JOGL 2 only under Mac OS X, because it's the only system where Java 1.5.2 can't run with Java 7 and I >had some problems to run Java 3D 1.6 / JOGL 2 under Linux and Windows last year. I just tried again and Sweet Home 3D still >fails under Windows but runs correctly under Ubuntu 12.04 with Java 7.

Is this under a real windows machine? Or windows inside a virtualization environment?  I seem to recall that
testing windows in that environment was futile as the opengl driver segfaults on the first Opengl call of
any kind....ie, not a jogl/java3d issue at all.  The only reason the old Java3d works is because of the directX backend.

Is that correct?

Harvey



Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
> Is this under a real windows machine?

No, I don't have any Windows PC. I could partition my hard disk, but would have to reboot for each test. And I tend to think that this issue probably reveals a problem that others could have too.


> The only reason the old Java3d works is because of the directX backend.

No, it works with Java 1.5.2 under OpenGL too. I'm sure about that because I never saw the DirectX switch work by itself, and anyway it's even not available under Windows 64 bits.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

gouessej
Administrator
Manu wrote
And I tend to think that this issue probably reveals a problem that others could have too.
I agree with Sven and Harvey, it should work without any trouble under Windows except if you use virtualization and there is nothing that we can do to fix that. My younger brother gave me a laptop under Windows 7; if you want, I can test Sweet Home 3D with it. Just provide me a link to a Webstart demo using Java3D 1.6 pre8 + JOGL 2.1.0 and I'll give it a try.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

Manu
This virtual machine is the Windows platform where I test Sweet Home 3D with Java 3D 1.5.2 until now, and I won't buy another PC. To avoid the virtual machine, I could partition my Mac OS X disk to install Windows on a second partition, but rebooting under Windows each time I want to make some tests would soon become tedious.
As suggested in a past message, I tried to run the program with Java 3D 1.6 / JOGL 2.1 with the sun.java2d.noddraw property set to true, and the program doesn't crash anymore. Instead, I get the following exception:
 javax.media.j3d.IllegalRenderingStateException: Java 3D ERROR : OpenGL 1.2 or better is required (GL_VERSION=1.1)
        at javax.media.j3d.JoglPipeline.setupCanvasProperties(JoglPipeline.java:7930)
        at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6332)
        at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4607)
        at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2378)
        at javax.media.j3d.Renderer.doWork(Renderer.java:879)
        at javax.media.j3d.J3dThread.run(J3dThread.java:270)
  Error in Java 3D : 3 Renderer: Error creating Canvas3D graphics context 
Could the error on the OpenGL version be a hint about this problem? Is OpenGL 1.2 really required to run Java 3D 1.6?

If you want to run some tests with Sweet Home 3D 4.2 beta run with Java 3D 1.6pre8 / JOGL 2.1 under Windows, Mac OS X or Linux, please use this executable Jar file.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

hharrison
Java3d always required at least OpenGL 1.4, although it had workarounds to continue working on 1.2 or 1.3 only with slightly degraded functionality.  The virtualized windows guest is claiming it only provides opengl 1.1....possibly the default GDI driver is being used?

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

hharrison
Actually, my mistake, it only requires 1.3, and has workarounds for working on 1.2...but for this case that doesn't help too much.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Mac Canvas3D location bug

gouessej
Administrator
In reply to this post by hharrison
hharrison wrote
The virtualized windows guest is claiming it only provides opengl 1.1....possibly the default GDI driver is being used?
Thank you for reminding that, I think you're right. Microsoft GDI driver is very poor and buggy, it emulates OpenGL through Direct3D and only supports OpenGL 1.1. As far as I know, no OpenGL-based CAD software intends to support this crap, some CAD applications use a software renderer as a fallback instead of relying on this kind of driver.

Java3D is a retained mode scenegraph, it requires decent support of vertex arrays which is the case of all known Java scenegraphs including Ardor3D, Xith3D, 3DzzD, JMonkeyEngine, Aviatrix3D, JPCT, ...
Julien Gouesse | Personal blog | Website
12345