This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Should i use java 3d API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Should i use java 3d API" Watch "Should i use java 3d API" New topic
Author

Should i use java 3d API

Madhur Baheti
Greenhorn

Joined: Nov 30, 2000
Posts: 12
I am planning to make a simple game of snake in java. I thought why not make a 3D snake, but i couldn't find any 3D drawing classes in java sdk.
I just require basic 3D shapes like cuboids and spheres. Would i have to go for the java 3D API? I really don't want to invest much time in that.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
When I searched for "Java 3D" at Yahoo I got nearly a million hits - the first page showed tutorials, toolkits, etc.
Bill
Grant Crofton
Ranch Hand

Joined: Nov 08, 2000
Posts: 154
Probably not. If you just want the snake game to look 3D (with a raised effect, like windows buttons) or even isometric (where the view is from a constant angle, like 45 degrees above), you are better of just creating 3D-looking graphics and making it as normal. A lot of games use graphics created in something like 3D Studio MAX, which are rendered into 2D and put into the game, which makes it look 3D but keeps things simple.
Java 3D can do a lot, but it takes a bit of learning, especially if you haven't done much 3D before. One you get into it it's fairly simple, but you have to learn all about scene graphs, transforms, behaviors etc before you can actually make anything useful. You can't just say cube(1,1,1) and get a cube on the screen, you need to set up a virtual universe, set up a view, etc..
If you want to make a full-on 3D snake, it would definately be worth looking into, but if you just want it to look good it's probably more hassle than it's worth.
Madhur Baheti
Greenhorn

Joined: Nov 30, 2000
Posts: 12
You mentioned

you are better of just creating 3D-looking graphics and making it as normal.

How do i go about this. Can u please elaborate how to create 3D looking graphics myself.
Grant Crofton
Ranch Hand

Joined: Nov 08, 2000
Posts: 154
At the most simple level, you can make something look 3D-like with a couple of coloured lines. If you are using Windows (or anything else that does this), just check out the buttons - they are a flat grey colour with lighter lines on the top & left, and darker lines bottom & right. This works quite well for blocky graphics, which you are probably using.
Taking it to the next level, you can create graphics in a 3D modelling package and use them in your game. This is a bit more involved of course, but you can get some 3D apps free, create the graphics you want, and render them to a 2D image. You can even aminate it like it's 3D - I did this with a vertical scrolling shooter, which had a 3D ship rolling as you moved sideways. it was simply a case of rendering it from about 10 different angles each side, and animating it within the game according to how the ship was moving. it was in C though, so the code probably wouldn't be much use.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Should i use java 3d API
 
Similar Threads
Regarding Car Race Game
where can i download the doc for java 3D
Java 3D Utility API
Java 3D
Should i use java 3d API