• Advertisement
Sign in to follow this  

[java] Java3D

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just wanted to know what do you think abouth Java3D. Could it be a good video game API? Cheers !!!

Share this post


Link to post
Share on other sites
Advertisement
I haven't read much about Java3D, but JavaOpenGL (jogl) has shown a fair bit of promise. (plus it is used basically the same as in other languages, so should you need/want to work in another language, you can switch over easily)

Share this post


Link to post
Share on other sites
I heard that LWJGL or JavaOGL (this is one being backed by Sun officially) are the way to go for 3D development in Java. Java3D as I heard it is no longer supported by Java officially.

Share this post


Link to post
Share on other sites
Java3D is and will be officially supported. Some time ago, it seemed that there was no active development, but this has changed. Further not only SUN's Project Looking Glass uses Java3D, but also new games like Cosmic Birdie.

Java3D offers a lot of useful stuff out-of-the box and offers a great functionality (including shaders,,), so IMHO it is a very good starting point. However, if you need to access the latest hardware features, jOGL are LWJGL are the right API.

Btw, the new versions of Java3D use the jOGL API and not OpenGL directly as the earlier ones.

Share this post


Link to post
Share on other sites
ok thanks guys.
I've got another question. Was the online video game Runscape developed in Java3D ?

Share this post


Link to post
Share on other sites
i'm quiet lost with all java api.
what are the differences between the following api :

-LWJGL
-JavaOGL
-Java3D

Basically I want to start a new game by using a java api, but i don't know which one to choose...

Share this post


Link to post
Share on other sites
LWJGL - OpenGL binding, also input and OpenAL
JOGL - OpenGL binding
Java3D - 3D scenegraph, API agnostic. It'll do a lot of difficult stuff for you, but it's unlikely to be exactly what you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by jolyqr
what are the differences between the following api :

-LWJGL
-JavaOGL
-Java3D


There are two API's in java that provide hardware-accelerated OpenGL access (use all the raw power of that shiny 7-series dual-SLI nVidia card you've got ;)):

JOGL: sun-supported C-style (i.e. NOT java style) API that looks just like using OpenGL in C. Traditionally had more performance problems than LWJGL and more bugs. Traditionally had slower development. None of that really true any more.

LWJGL: games-dev community effort started at approx same time as JOGL, but focussed more on working fast and getting to release sooner. Has been used in quite a few commercial games. Because games need more than just OpenGL - they need some sound too, and java has no proper working input system for joysticks etc, LWJGL added those in too, making it a complete system for games dev. Most people used it for the OpenGL.

Both have become less distinguished over time, especially now that they share a lot of common modular elements, e.g. integration with scenegraph APIs, integration with input systems.

LWJGL is still innately preferred by a lot of games devs because of its pedigree, but it's hard to demonstrate a large real difference between the two now - except that LWJGL is a bit more java-friendly, and a bit easier to use sound API's like OpenAL, whereas JOGL is a bit easier to use with AWT stuff if you need to do backwards compatible etc.

...

Java3D should be compared side by side with: JME, Xith3D and others.

Share this post


Link to post
Share on other sites
Quote:
Original post by redmilamber
Quote:
Original post by jolyqr
what are the differences between the following api :

-LWJGL
-JavaOGL
-Java3D


There are two API's in java that provide hardware-accelerated OpenGL access (use all the raw power of that shiny 7-series dual-SLI nVidia card you've got ;)):

JOGL: sun-supported C-style (i.e. NOT java style) API that looks just like using OpenGL in C. Traditionally had more performance problems than LWJGL and more bugs. Traditionally had slower development. None of that really true any more.

LWJGL: games-dev community effort started at approx same time as JOGL, but focussed more on working fast and getting to release sooner. Has been used in quite a few commercial games. Because games need more than just OpenGL - they need some sound too, and java has no proper working input system for joysticks etc, LWJGL added those in too, making it a complete system for games dev. Most people used it for the OpenGL.

Both have become less distinguished over time, especially now that they share a lot of common modular elements, e.g. integration with scenegraph APIs, integration with input systems.

LWJGL is still innately preferred by a lot of games devs because of its pedigree, but it's hard to demonstrate a large real difference between the two now - except that LWJGL is a bit more java-friendly, and a bit easier to use sound API's like OpenAL, whereas JOGL is a bit easier to use with AWT stuff if you need to do backwards compatible etc.

...

Java3D should be compared side by side with: JME, Xith3D and others.


ok, everything is becoming clearer...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Michael Nischt
Java3D is and will be officially supported. Some time ago, it seemed that there was no active development, but this has changed. Further not only SUN's Project Looking Glass uses Java3D, but also new games like Cosmic Birdie.

Java3D offers a lot of useful stuff out-of-the box and offers a great functionality (including shaders,,), so IMHO it is a very good starting point. However, if you need to access the latest hardware features, jOGL are LWJGL are the right API.

Btw, the new versions of Java3D use the jOGL API and not OpenGL directly as the earlier ones.


What do you mean with "official support"?. There is a JSR for Java3D 1.3, 5 years old with an 1.4 "maintenance" version JSR, there was a Sun implementation, but Sun has donated the project to open source community and a new and ambitious JSR was dropped a year ago or so. Shader support is limited and no one use it now.

I dont think Java3D is the best Java option talking about games. Its 6 years old and its use has gone down.

Share this post


Link to post
Share on other sites
Quote:

What do you mean with "official support"?. There is a JSR for Java3D 1.3, 5 years old with an 1.4 "maintenance" version JSR, there was a Sun implementation, but Sun has donated the project to open source community and a new and ambitious JSR was dropped a year ago or so. Shader support is limited and no one use it now.

I dont think Java3D is the best Java option talking about games. Its 6 years old and its use has gone down.


With "official support", I mean the same as for jogl: Its an open source project powered by SUN. Btw. daily builds of Java 3D 1.5 are already available on java3d.dev.java.net.

I never said it's the best option for game dev in java, but it's not as bad as mainy think.. and its object oriented architecture make it easier to start with IMHO..

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Michael Nischt
With "official support", I mean the same as for jogl: Its an open source project powered by SUN. Btw. daily builds of Java 3D 1.5 are already available on java3d.dev.java.net.

I never said it's the best option for game dev in java, but it's not as bad as mainy think.. and its object oriented architecture make it easier to start with IMHO..


If that means a project is "powered" by Sun, then majority of Java projects are. Java3D has passed from Sun active development, to service maintenance, to be dropped in favor of a "community" development. I think nothing interesting can be learnt from Java3D, its a scenegraph API with little support and declining day by day. Its nearer from a 3d scene modelling tool than a 3D graphics API. But dont misinterpret me, i think Java3D is an ok tool if you want to include 3D support in conventional apps, but a bad election to construct a performance one, as a game can be. Its a shame that there isnt a Ogre port for Java under Jogl, could be a fine and learning curve friendly.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry, and addition. There is a ongoing port of Ogre for Java, called Ogre4j (original name, :) ). But seems to be in a very very alpha stage.

http://www.ogre4j.org/drupal/

Share this post


Link to post
Share on other sites
I would suggest looking into both and try making simple stuff with both. I use LWJGL myself and also find the input handling very useful. Most calls from OpenGL are almost exactly the same, with the except that that Java versions are static methods in classes. Example drawing code for simple openGL and the LWJGL equivalent for drawing a simple triangle strip:


//way earlier
import org.lwjgl.opengl.GL11;

//LWJGL version
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
GL11.glTexCoord2f(0.f, 0.f);
GL11.glVertex2f(x, y);
GL11.glTexCoord2f(0.f, 1.f);
GL11.glVertex2f(x, y + height);
GL11.glTexCoord2f(1.f, 0.f);
GL11.glVertex2f(x + width, y);
GL11.glTexCoord2f(1.f, 1.f);
GL11.glVertex2f(x + width, y + height);
GL11.glEnd();






//Cpp version
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureID);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(0.f, 0.f);
glVertex2f(x, y);
glTexCoord2f(0.f, 1.f);
glVertex2f(x, y + height);
glTexCoord2f(1.f, 0.f);
glVertex2f(x + width, y);
glTexCoord2f(1.f, 1.f);
glVertex2f(x + width, y + height);
glEnd();




Keyboard events in LWJGL also don't work on an event queue, but rather can be polled directly. Example, no MouseListeners or anything, but rather anything can check a key simply like this (more complex ways are also available):


// returns true if RETURN (enter) is pressed
// can be put anywhere in your code (e.g. in update method for game objects)
Keyboard.isKeyDown(Keyboard.KEY_RETURN);




Keep in mind though, that a lot of which library is better is to look into them yourself. Some things easy in one, will be a pain in the other (e.g. entering names for high scores in LWJGL for my asteroids clone was annoying because i had to do MUCH more work since there was no KeyListener's keyPressed(KeyEvent...) method, but I had to manually check keys. But simply checking for key presses is MUCH easier in LWJGL).

Share this post


Link to post
Share on other sites
Hi,

If you are looking for a very good API to substitute in place of Java3D. I would suggest jME works very well, easy to develop with and has a good supporting community. Just another option since the Ogre4j has been taking a while to really get things working.

jME is a scenegraph API built on top of LWJGL with model loading support as well as lighting, animation, sound, and much more. I think it is a better choice for a video game API than Java3D but still Runescape was done using Java3D so it's still a viable solution if you don't have very high requirements on the graphics end.

Share this post


Link to post
Share on other sites
Quote:
Original post by 5MinuteGaming
Hi,

If you are looking for a very good API to substitute in place of Java3D. I would suggest jME works very well, easy to develop with and has a good supporting community. Just another option since the Ogre4j has been taking a while to really get things working.

jME is a scenegraph API built on top of LWJGL with model loading support as well as lighting, animation, sound, and much more. I think it is a better choice for a video game API than Java3D but still Runescape was done using Java3D so it's still a viable solution if you don't have very high requirements on the graphics end.



You're right, that's fantastic. I didn't that doing things like that in Java could be possible...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement