Where to start with 3d

I was wondering if anyone could help me by suggesting where to start with 3d graphics programming. I am comfortable with Java2d and would like to learn something new. Specifically:

  1. what should I use for begginer 3d? Java3d or do everything from scratch?

  2. where can I find some could simple tutorials to hepl me understand the basic concepts?

  3. where can I find the proper easy to understand math documentation?

Any feedback is much appreciated.

Well, I’m hardly an advanced 3d programmer, but
I would suggest downloading LWJGL and play with the examples, download the open-gl specs at www.opengl.org and stop by at http://nehe.gamedev.net/ (nice open-gl tutorials).

I think it’s easier to begin with open-gl than to start with java3d, because using java3d kind of assumes you’re familiar with many 3d concepts which might be intimidating.
With straight open-gl it’s fairly easy to do some simple yet cool looking stuff but it will get complicated once the math gets involved if you want to do more complicated things.
Once you get to the point where you will need a lot of complicated math stuff, thats the point where j3d probably becomes the easy road as much of that rocket science is already done for you.

I hope this helps :slight_smile:

Lwjgl would be a good starting point, Java3d is disappointinly sparse on info/tutorials for a beginner. For Java3d, the best you’ll get are the Sun tutorials and j3d.org.

Math documentation - well theres several articles over at GameDev.net, and http://www.flipcode.com/geometry/ at flipcode amongst other things. Other that that I’d just recommend the graphics bible: http://www.amazon.co.uk/exec/obidos/ASIN/0201121107/qid=1045003354/sr=1-1/ref=sr_1_18_1/202-9652400-6331058

I suggest to ignore all this Java3D, LWJGL and whatnot stuff and to build a simple (maybe just flatshaded using Java2d) “3d-engine” yourself. You won’t need that much math at the beginning. Try to rotate a flatshaded cube or something. I’m always scared when reading things like “i’m writing an 3d engine using OpenGL but what are matrices? (read: I don’t have a clue what i’m doing here, but i’m a master of copy-and-paste)”.
Of course, this approach won’t lead you to something people are making Ahhs and Ohhs about…but for learning purposes, i think it’s still the way to go.

Ok, to have any possible opinion here…

Go for Java3D. With the samples provided with the distribution, the sources of the utilities and the repository on j3d.org, there is an easy path to get something meaningful on the screen quickly.

If you have some artwork - theres lot on the net - in 3DS, milkshape, OpenFlight, … there are good loaders around and you can assemble 3D scenes with ease.
Without having to deal with rather technical details like culling, clipping, sorting, renderstates, blendmodes, vertexbuffers etc.

With tools like j3dtree or the FlyTrough or the scenegraph editor you can analyze e.g. how a loader constructed a sub-scenegraph and learn from that.

For a basic understanding of 3D techniques, ask amazon. Or the people here.

I tried getting into java3D several times without success. I think I tried to do too much at once. What finally worked for me was to create a 2D game using java3D (textured squares for my tiles & sprites). Anyway, it helped me get into java 3d, maybe an approach to try.

I think I would perfer to take the road suggested by EgonOlsen. I would like to try to create a simple flat shaded cube with java2D and then to see if I can get it to rotate. Now the question is how do I do it. I am guessing that it is just a 3d drawing algorithm. Any suggestions or links to books or tutorials that would help me achieve my desired results would be very helpful.

http://www1.jawink.ne.jp/koji-y/java/jvrrc.htm

Download the beast and decompile it. Nice to see what can be done in ~1000 lines of Java…

It does not use more than fillPolygon() to draw things!

Thats a little too complicated to start with

I used the Sun J3D tutorials at http://developer.java.sun.com/developer/onlineTraining/java3d/

The tutorial is a little tough to navigate, but it’s pretty good, and covers the API pretty broadly. I copied and adapted some code from chapter 7 to get some textured planes moving around.

I fully agree with EgonOlsen. Write your own software engine to get knowledge whats going on behind the scenes so to speak. He has got a rather impressive java 3d software engine up and running. :wink:
Or you could write a raytracer :slight_smile: Might not be realtime but you will learn alot about 3d graphics. A basic raytracing tutorial can be found here http://www.2tothex.com/raytracing/

[quote]He has got a rather impressive java 3d software engine up and running. :wink:
[/quote]
It’s not just software any longer. It supports OpenGL via LWJGL now. However, i won’t move away from software rendering with this engine…i love to have control about every single pixel…and in Java, i think that software rendering still has a right to exist.

Just start with OpenGL using LWJGL. It’s really a lot easier than everyone makes out. The reason I started investigating OpenGL in the first place is because J3D was so difficult to understand. (A wise decision in the end, given how crappy I think J3D is).

Cas :slight_smile:

[quote]I’m sure writing a full software renderer is very enjoyable for you. However, for the majority of programmers out there its a bit of a waste of time.
[/quote]
He was talking about learning not about a deadline to met or a specific project to finish, so i don’t see a waste of time unless the learning itself is one. I wasn’t talking about writing a fully featured software renderer. Just something small that renders some flat shaded polygons. Using OpenGL or D3D or similar to learn (not use!) 3D is like using Collections.sort() to learn how a sorting algorithm works IMO.

Don’t think so. There are just other things to learn. Around 1997/98 is was black art being able to write a fast rasterizer. Of course, it still is, but nobody today can take much advantage of that knowledge and other things are far more important.

[quote]EO,

By your logic, before starting to write your own renderer you should first understand the nature of reality.

We live for finite time, and only have finite space in our minds. Learning into detail of something that has been done many times before is in most cases futile.
[/quote]
I guess you started to learn math using a pocket calculator then?!

I still agree with EO ;D
Writing your own software renderer “forces” you to learn about illumination models, transformation (best learned from a math book though IMO) etc. stuff that will be useful when you get to shader programming. As said before the rasteration of the polygons can be done by java2d as such project isnt supposed to be fast, the primary objective is to learn the basic of 3d programming.

It doesn’t appear to have done me any harm starting with OpenGL… and to use OpenGL properly you still need to understand most of the theory; it’s just that it also teaches you about the thing that software-renderer proponents forget about, which is how to use an API effectively to make a rendering operation work with hardware efficiently. These days that’s equally as important as knowing the maths.

Cas :slight_smile:

Starting with OpenGL is also very motivating because things start to look good very easily. With my 1st 3d game, there’s hardly any complicated math involved even though I did write a flat shaded software renderer once on my old Atari ST (that was a looong time ago). That math knowledge is very rusty :stuck_out_tongue: but I’m picking it up again.
The thing for me always is, if you gonna learn something, make it fun to learn it. Getting a math book and first studying it for a year before creating anything isn’t much fun for me at all.