Creating high quality games using Java3D

hi guys, I just wanted to share with you some of my experience with using Java and Java3D in a games project.

Below I will compare my initial reasoning for choosing Java/Java3D with my experience so far with Java/Java3D

Before starting developing the game I considered a wide array of different 3D-API’s and languages.

My initial reasoning for choosing Java/Java3d

  • The game-code will run on a huge array of platforms.

  • Java3D is not yet a part of Java2, but it will probably soon be.

  • Java is fast enough on todays computers.

  • Java and Java3D has a huge library of ready-to-use code in the API. Many important things that I need in my game are readily available for me to use.

  • The internet is full of articles and source-code ready to use. Not that much Java3D really, but Java stuff is everywhere.

  • I will save a lot of time using Java/Java3D.

My experience so far with Java/Java3D

  • All of my expectations above came through except the fact that Java3D now has an uncertain future (Please read the ongoing debate about JOGL vs. Java3D).

  • Much of the API-functions in Java3D is extremely usefull and saves you a lot of work.

  • There are some dangerous pitfalls in Java3D in terms of performance. However, I found simple sollutions to these problems either on Sun’s pages or on www.j3d.org.

All in all I choose to continue using Java3D. It works and it is a mature 3D API ready to use. But, I make sure that the structuring of my code allows for easy porting to another API if neccessary.

If you decide to use Java3D despite the ongoing debate about its viability, make sure you isolate all the Java3D code in generalized classes. This means that you shouldnt have Java3D code spread around in the game’s sources. Design the Java3D part as a set of interfaces. This will make it easy to convert to another 3D-API in the future, and it is a nice way of organizing the programming of a game.

FG

Thanks for the sharing, FG!

My experience was similar, both the pre- and post-, with a couple of differences:

  1. I found that going from basic functionality (prototype) to full-blown functionality was actually a lot of work, although this could be because we are using a lot of 3D shapes and had to figure out what was the best way to break them up was. (In our case we have entire planets composed of 4 million triangles, plus a boatload of other complex 3D shapes)

  2. Java3D is more memory-intensive than I would like, but not unmanageably so, if SharedGroups and Links are used intelligently.

  3. There’s no good framework for animations. Perhaps I should say, no good high-level framework – there’s lot of RotPosScaleInterpolators and such. But if you want to import a pre-generated model with it’s animations you have to roll-your-own animation system.

That said, I have still really liked working with Java3D and I am highly disappointed that it’s stalled out. I will probably port our existing Java3D code to Xith3D or some other high-level scene-graph API when they get a little more mature. Unless Sun releases the Java3D code as open-source or something so we can continue to extend it.

well, for the moment, it’s only windows/solaris/linux(working?). I doubt more platforms will be available for java3d in the future.

I personally don’t think so.

About the rest, i totally agree, java3d is really a wonderfull api! ;D
I’m also going on with it and glad to do so.