Sign in to follow this  
Gordo4444

[java] Good Java 3D tutorial

Recommended Posts

Hey everyone. I've been dredging the internet for hours now looking for a good, solid tutorial on Java3D. I find a few here and a few there, however most of them are either incomplete or use a different API. Does anyone know of a good tutorial site they could pass my way? Thanks! ~Gordo~

Share this post


Link to post
Share on other sites
I recommend jpct. It's easy to get something running in no time with it, has a basic physics implementation, and also supports software rendering in addition to OpenGL. With software rendering jpct is compatible all the way down to Java 1.1 -- or so it claims; I've never verified this.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Quote:
Original post by Gordo4444
Quote:
Original post by Antheus
Java3D was abandoned cca 2003 or so.


So you're saying I should find a new API? Like Jogl or something?


Jogl was abandoned last year...

Hahaha, are we seeing a pattern here?


Quote:
Original post by smr
I recommend jpct. It's easy to get something running in no time with it, has a basic physics implementation, and also supports software rendering in addition to OpenGL. With software rendering jpct is compatible all the way down to Java 1.1 -- or so it claims; I've never verified this.

Software rendering also has the benefit of running in an unsigned applet. But it's also slow, so it may not be particularly helpful depending on the game it will be used for.

Share this post


Link to post
Share on other sites
Like Antheus said, you want to be looking at LWJGL. The good news is that it's a very direct mapping of OpenGL into Java.

If you want a scene graph instead, there are a number of contenders such as JME, Xith3D, Ardor3D (in active development as "the" JME replacement), Aviatrix3D (based on JOGL and also looking rather abandoned), etc.

Share this post


Link to post
Share on other sites
I think it depends on his goal. If his goal is to climb the steep learning curve of OpenGL and 3D math and eventually write a game, then LWJGL is the way to go. If he wants to write a game now, then using an engine such as jMonkeyEngine or jpct is the right tactic.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Java3D was abandoned cca 2003 or so.

And picked up as a community source project in 2004. Currently there is work going into integrating Java 3D with JavaFX, so it definitely isn't dead.
http://en.wikipedia.org/wiki/Java_3D#History

Quote:
Original post by Antheus
Jogl was abandoned last year...

This one also seems to be false, although information on this seems more hazy and scattered.

It seems whenever you've seen the word "abandoned" anywhere you've jumped to the conclusion that a whole initiative has been binned permanently; or you've conflated "community project" with "abandoned", which makes the likes of LWJGL no better, really. If you have better grounds upon which you've based your assertions, could you provide them?

In answer to the OP's question, nfi, largely; you could probably follow any OpenGL tutorial for JOGL, though.
I'm not a graphics guy by any means, and I'm likely to be shouted down by actual graphics programmers for not going with a hacky-enough solution, but I once again stress the importance of platform-independence. That is, favour libraries that are part of or built upon the Java SE library, and, failing that, pick something with multi-platform support and don't conflate any platform-dependent aspects of the library (ie JNI) with your application.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fenrisulvur
That is, favour libraries that are part of or built upon the Java SE library, and, failing that, pick something with multi-platform support and don't conflate any platform-dependent aspects of the library (ie JNI) with your application.


While laudable in theory, in practice you eventually have to talk to the OpenGL driver on that platform somehow, and at the end of the day that means JNI calls, whether hidden by the JRE from you or not. LWJGL does run on Windows, Linux, Solaris, and Mac, making it "good enough" in terms of platform independence in practice. Note that I do not mention JOGL purely because I have never used it or even looked at it myself and am therefore not qualified to talk about it.

Share this post


Link to post
Share on other sites
Quote:
Original post by lightbringer
While laudable in theory, in practice you eventually have to talk to the OpenGL driver on that platform somehow, and at the end of the day that means JNI calls, whether hidden by the JRE from you or not.

Sure, but your core game application doesn't need to be riddled with them, even if you do need to write some of it yourself. You should be able to facade any platform-dependent code off into a separate component that you could call a "driver", and dynamically pull it in at runtime. Java does this well.

Share this post


Link to post
Share on other sites
The only platform-dependent code that you have when you use LWJGL is for loading the application icon, because different operating systems require amount and size of icons to be passed in. Even then, it's only natural to section this off together with the rest of the LWJGL code. Certainly nobody is suggesting that you have LWJGL proliferate throughout all of your application. The only parts that need to know about LWJGL are the audio system, the renderer, the display creation system, the texture and buffer object creators, and the input system. If you follow the standard maxim of coding to interfaces, you could plug something else in later on.

So I am actually of the same opinion that you are, I was just not clear about it. I was leaving in a hurry earlier, so I read "don't spread JNI" as "don't use JNI". My fault :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Fenrisulvur
Quote:
Original post by Antheus
Java3D was abandoned cca 2003 or so.

And picked up as a community source project in 2004. Currently there is work going into integrating Java 3D with JavaFX, so it definitely isn't dead.
http://en.wikipedia.org/wiki/Java_3D#History

Quote:
Original post by Antheus
Jogl was abandoned last year...

This one also seems to be false, although information on this seems more hazy and scattered.

It seems whenever you've seen the word "abandoned" anywhere you've jumped to the conclusion that a whole initiative has been binned permanently; or you've conflated "community project" with "abandoned", which makes the likes of LWJGL no better, really. If you have better grounds upon which you've based your assertions, could you provide them?

In answer to the OP's question, nfi, largely; you could probably follow any OpenGL tutorial for JOGL, though.
I'm not a graphics guy by any means, and I'm likely to be shouted down by actual graphics programmers for not going with a hacky-enough solution, but I once again stress the importance of platform-independence. That is, favour libraries that are part of or built upon the Java SE library, and, failing that, pick something with multi-platform support and don't conflate any platform-dependent aspects of the library (ie JNI) with your application.


You don't think Java3D has platform dependence? It might be packaged from Sun but it still uses JNI in the backend to access DirectX or OpenGL.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this