Looking for working Ardor3d example...

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

Looking for working Ardor3d example...

adanecito
Hi All,

I noticed jogamp is somewhat supporting Ardor3d 1.0. I am trying to get it to work but finding out that it changed to support jogl 2.x. I am tring to get it to work again and not sure for the loader what to do about setting up correctly JoglRenderContext and JoglContextCapabilities. I thought I had it working but get an exception about a nullpointerexception when com.ardor3d.renderer.jogl.JoglRenderer.doTransforms is called by JoglRenderer.java:705

I will attach my snippet from my initialization method next.

Thanks,
-Tony
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

adanecito
Hi All,

Thanks for any idea what I am doing wrong. I am using GLJPanel if that helps.


        public static void initializeArdorSystem(final DrawContext dc) {

                 if (ContextManager.getContextForKey("HACKED CONTEXT") != null) {
                JoglRenderContext rc = (JoglRenderContext) ContextManager.switchContext("HACKED CONTEXT");
                        return;
                }
                 
                if (_context == null) {

                        CapsUtil capsUtil = new CapsUtil();
                        _context = GLDrawableFactory.getFactory(capsUtil.getProfile())
                                        .createExternalGLContext();

                }
               
                final JoglContextCapabilities jcaps = new JoglContextCapabilities(
                                dc.getGL(), new DirectNioBuffersSet());
                final JoglRenderContext rc = new JoglRenderContext(_context,jcaps, null);
               
                 //final RenderContext rc = new RenderContext(dc.getGLContext(), jcaps);

                ContextManager.addContext("HACKED CONTEXT", rc);
                ContextManager.switchContext("HACKED CONTEXT");
               
                //ContextManager.addContext(CONTEXT_KEY, rc);
                //ContextManager.switchContext(CONTEXT_KEY);

                // disable Ardor3d's frustum culling, as we don't use Ardor3d's camera
                // system:
                Camera cam = new Camera() {
                        @Override
                        public FrustumIntersect contains(BoundingVolume bound) {
                                return FrustumIntersect.Inside;
                        }
                };
                ContextManager.getCurrentContext().setCurrentCamera(cam);
                AWTImageLoader.registerLoader();
        }
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

adanecito
Ok I got it working! Almost back to where I want almost.

-Tony
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
In reply to this post by adanecito
Hi

I'm maintaining Ardor3D and I ported it to JOGL 2 several years ago. I remind you that there are tons of examples in the sub-project ardor3d-examples. It is still working, it isn't broken, I use several loaders both in TUER and in JFPSM without getting a NullPointerException. Moreover, which repository do you use to get Ardor3D? Why do you want to know what I changed to make it work with JOGL 2? It has worked for years. Best regards.

Edit.: You seem to be using it with Worldwind. There is an example of initialization in the wiki but it's a bit outdated. Maybe this particular example is broken but Ardor3D in general just works. Please post your findings.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
Any idea what this guy did to solve the problem?  I'm trying to do the exact same thing with WorldWind.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
The legacy Ardor3D is no longer maintained, I only maintain JogAmp's Ardor3D Continuation. Do you use JogAmp's Ardor3D Continuation? There is still an obsolete example in the old wiki. Please post your stack trace, I'll see what I can do.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Xerxes Rånby
In reply to this post by Clint
Clint wrote
Any idea what this guy did to solve the problem?  I'm trying to do the exact same thing with WorldWind.
World Wind Java SDK 2.0 is already using JogAmp JOGL and is working fine.
you can get the worldwind 2.0 SDK from:
http://worldwind.arc.nasa.gov/java/
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Xerxes Rånby
In reply to this post by gouessej
gouessej wrote
The legacy Ardor3D is no longer maintained, I only maintain JogAmp's Ardor3D Continuation. Do you use JogAmp's Ardor3D Continuation? There is still an obsolete example in the old wiki. Please post your stack trace, I'll see what I can do.
Installation instruction for the JogAmp's Ardor3D Continuation is here:
https://gouessej.wordpress.com/2014/11/22/ardor3d-est-mort-vive-jogamps-ardor3d-continuation-ardor3d-is-dead-long-life-to-jogamps-ardor3d-continuation/#installation

Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
In reply to this post by Xerxes Rånby
But the problem I'm having is probably the one he was having.  That is, in this section of the code:

            final JoglContextCapabilities caps = new JoglContextCapabilities(dc.getGL(), new DirectNioBuffersSet());
            final RenderContext rc = new RenderContext(dc.getGLContext(), caps);

WorldWind's DrawContext (the dc variable) provides a getGL() method, which is what was passed into the JoglContextCapabilities constructor for version 1.0.  This gives you a javax.media.opengl.GL, but the constructor is expecting com.jogamp.opengl.GL.

Also, I'm not really sure what "new DirectNioBufferSet()" is providing or whether this will work in my application.  But one problem at a time...

I'm using WorldWind 2.0 (uses jogl 2.0) and the ardor3d that has been ported to jogl 2.0.

Also, thank you so much for responding and helping!!!
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
I ported the legacy abandoned Ardor3D to JOGL 2 but it uses an obsolete version of JOGL, i.e JOGL 2.1.4-rc-20140126 whereas JogAmp's Ardor3D Continuation uses JOGL 2.3.2 but WorldWind 2.0 uses JOGL 2.0 or 2.1. Please ask the maintainers of WorldWind to switch to JOGL 2.3.2 and it will work correctly with JogAmp's Ardor3D Continuation.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
That is extremely helpful information.  I will see if updating to the newer version of World Wind already uses that version of JOGL.  I'd really prefer to use this older version of World Wind, because the newer version runs slower for me.  Is there any way I can get your version of ardor3d that works with 2.14?

I'm really impressed with the help you guys are giving.  Thanks so much!
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
No it's not possible, JogAmp's Ardor3D Continuation always uses the latest features and the very latest version of JOGL, about 100 commits have been done after updating several times the version of JOGL used in the engine. I do my best to allow the end users to benefit of the latest bug fixes, using an older version of JOGL would completely defeat this purpose and would expose you to tons of problems. I don't maintain several branches, it would be too much time consuming and it would bring almost nothing to the users of the engines.

Why not trying to know why the newer version of WorldWind is slower on your hardware?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
In reply to this post by Clint
I've been trying to hunt down a version that uses JOGL 2.14.  I found one, but it doesn't have the ardor3d jars with it.  I'm having a whole lot of trouble getting this stuff to build.  Anyone know where I can find ardor3d jars that are compatible with World Wind's version of JOGL?

I also tried using World Wind's latest, and unfortunately they did not update.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
In reply to this post by gouessej
Well I suppose I could do that, but World Wind's code base is very big.  I think the best solution would be to make a custom version of World Wind that uses the newer version of JOGL 2.  Thanks for the help!

Clint
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
Please just ask the maintainers to update their source code, switching to the latest version of JOGL requires some dummy changes (mainly in the import clauses). It would allow you to use the master branch without having to make a custom version of WorldWind.

JogAmp's Ardor3D Continuation is easy to build, "mvn install" (or use Gradle) and it's done :) It can't be easier.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Xerxes Rånby
This post was updated on .
In reply to this post by Clint
Clint wrote
Well I suppose I could do that, but World Wind's code base is very big.  I think the best solution would be to make a custom version of World Wind that uses the newer version of JOGL 2.  Thanks for the help!

Clint
The NASA World Wind project has moved to GitHub, this makes it much easier to download and automatically update the sourcecode to make your own version compared to when NASA used centralized SVN.

I have already done a quick port using a Linux system by running some quick find and replace commands on all the java files in the WorldWind git.
You can get my port from my git tree here:
https://github.com/xranby/WorldWindJava/

you compile it by running
ant

and test it by running
./run-demo.bash gov.nasa.worldwindx.examples.Pyramids
./run-demo.bash gov.nasa.worldwindx.examples.FlatWorldEarthquakes

And i have sent in my changes to NASA for review here:
https://github.com/NASAWorldWind/WorldWindJava/pull/1
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
Great job, thank you very much.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

robotfire
That's awesome, I'm really happy you did that.  I actually got it working with a version of Ardor3D that I found.  It's based on the same JOGL 2 version that World Wind currently uses.  The Ardor3D Collada models look absolutely incredible in it - much better than they do with the World Wind Collada support.  I hope World Wind accepts your changes.  I'd prefer to have an official copy of World Wind, but I may go your route down the road if they don't update accordingly.

I'm really impressed with the support you all are offering here.  Thanks again.  I couldn't have gotten this far without your help.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

gouessej
Administrator
Of course they will accept Xerxes' changes as it will give less work to them, they can't stop updating JOGL.

I really hope that you'll use JogAmp's Ardor3D Continuation with xranby's changes on WorldWind in order to benefit of the numerous features and fixes I implemented since Renanse abandoned the legacy obsolete version of Ardor3D you're using. If something goes wrong, you will be alone with your bugs if you go on using some obsolete versions of libraries.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for working Ardor3d example...

Clint
I was having trouble with a random crash, so I updated to the newest versions of jogamp, worldwind (thanks for updating that!), and ardor3d.  However, I still get the following error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x5dc7200e, pid=8612, tid=7828
#
# JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
# Java VM: Java HotSpot(TM) Client VM (25.66-b17 mixed mode windows-x86 )
# Problematic frame:
# C  [nvoglv32.DLL+0x8e200e]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\OSM\LITMUS\LcsExe\hs_err_pid8612.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
12