Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should i use java 3d API

 
Madhur Baheti
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic