The Little Purple Dude Walks - A Limited Adventure in Java3D

by Ben Moxon

I have been playing around with Java 3d for a little while now and one of the main things I have noticed as I struggled to achieve anything is that although there are a whole lot of tutorials about how to do various specific things and a few good books that cover what you need to know I have yet to find a basic tutorial that takes you from not knowing very much about the Java3d system to knowing a enough about it to have something to show for it. I think the vast majority of people who are interested in Java3D are interested in it from a gaming point of view and it seems to me that they probably don’t want to spend their time working with cones and colourcubes, pleasant as those are if you like that sort of thing. Unfortunately, because there isn’t already a tutorial like this one, I have been working out how to do it as I wrote it, learning by doing as it were. Consequently my solutions are likely to be a long way from optimal in most cases and will probably fall into the realms of “bad” very often. This is good, because it offers you, the reader, the interesting challenge of improving them.

The tutorial quite long, so I have divided it into sections- remember that these are parts of the same tutorial and not standalone lessons, so they may not make sense if you jump straight in at the middle. The sections are as follows:

Getting Started
Creating the Scene (in which we create a basic Shape3D)
That other Landscape (in which we create a more complex Shape3D)
Importing a Model (in which we import a model from a 3d design program)
The Mobile Manikin (in which we use keyframes to animate our model)
Now We’re Getting Somewhere (in which we move the model as it is animated)
Up Hill and Down Dale (in which we implement basic terrain following)
Finally… In followcam footage (in which the camera follows our mobile terrain-following model)
Where Now?

The code I have based the tutorial on is available in a zip file. If you run into any mistakes or errata don't hesitate to let me know- you can contact me using my first name at benmoxon.info or the contact page on this site. Read the "Where now" section for an explanation of why it is pointless to ask me directly for help with your project.

Update: I am now a freelance programmer, my own boss, so if you do want to ask me to help with stuff it will only cost my usual hourly rate, which may be relatively affordable. You can find out more about my skills and see a commercial program for which I used Java3D here at www.benmoxon.info.