[java] Java and 3D

Started by
11 comments, last by SirCyr 23 years, 6 months ago
Hello there I was wondering if it was possible to render 3D graphcis in java,,,with OpenGl for example. and if so, would the rendering speed be comparable to the one I would get with a C++ app?
Advertisement
I don''t know about performance but I know you can use OpenGL in Java

I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
I wish there was a button on my monitor to turn up the intellegince. Theres a button called 'brightness' but it doesn't work
You can get Magician here and I have never measured but I would bet it is %80 to %90 of a c++ program. This might mean that instead of 90fps you get 80fps. I don't see a difference but some people do. Implement your culling algorithms correctly and you're good to go.

I wanrned you! Didn't I warn you?! That colored chalk was forged by Lucifer himself!

Edited by - GKW on September 30, 2000 1:18:42 AM
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
You can also use GL4Java available from Jausoft to create OpenGL Java applications/applets.

If you are interested I have ported some of the popular Nehe OpenGL tutorials to Java using the GL4Java library here on my site (Shameless plug :O)

Have fun!



- Hodglim
Homepage
- HodglimHomepage
ohh it is nice then

Im familiar with c++ and I was planning to study java...

so I guess that if OpenGl is accessible, a 3D game could be made in java at reasonable speed...

The OpenGL ARB has asked that the Magician binding become the official binding so since you don''t know either I would suggest you go with Magician over GL4Java. The tutorials are easy enought to port over. Give you some good experience with Magician too.

I wanrned you! Didn't I warn you?! That colored chalk was forged by Lucifer himself!
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
You can also get an overview with links to several starter articles on using OpenGL with Java from the thread''s FAQ. On that page there are links to at least 4 different implementations of Java-To-OpenGL bindings, but you are probably better off sticking with Magician or GL4Java (I believe they have the largest mind share, and Magician looks like its the OpenGL ARB standard now with that recomendation from SGI).

http://games.cpbinc.com/faq/ogl.asp

(I swear no one ever looks at that thing...)
Nar, you don''t wan''a do it like that
http://developer.java.sun.com/developer/onlineTraining/java3d/
for all the info on the Java 3D Api (from sun) which has interfaces for Direct-X (or what ever you M$ clowns are calling it now) and Open-GL (which is quite nice). Its a bit of a bummer to get your head round through!!
I actually attempted to build a 3D game engine using the Java 3D API. Not only was there very little in the way of decent documentation and existing code references, but the performance and system requirements necessary to achieve decent performance meant that my game would run on only about 2% of all PC''s in existence. And Java 3D is a MAJOR memory hog. You need at least 128 MB of memory, and more like 256 MB to be comfortable.

At first I did not trust what I was seeing - I thought maybe I just didn''t know how to tweak performance out of the API. So I downloaded code from various sites - some from NCSA - and tested the performance and system requirements of those programs. I got the same results.

I also had some problems with limitations in the API - such as only being able to detect one collision at a time and the lack of support for animated textures. The fact that the API ignores other collisions while in the process of handling a first collision was a big problem.

Overall I decided to go with OpenGL and wait for one or two more revisions of Java 3D before trying to build a game with it.
First, I don''t believe that any OpenGL wrapper for Java can run nearly as fast as the same program written in C++. I like Java and use it for games but OpenGL is a fairly low level API (in comparison with complete 3D engines that is such as Genesis3D) meaning that many calls are required through the wrappers slowing it down. A framerate drop of 90 to 80 is not likely for a thin OpenGL wrapper. I don''t believe it. It must be much worse.

However, if you use a higher level API with a complete engine built in and this engine is written in C++ and you just access it through few calls then this will be able to achieve quite high frame rates.

I am currently getting paid for writing a Java wrapper for the Eldermage 3D engine. Eldermage already runs in Visual C++, Visual Basic (ActiveX), C++ Builder, and Delphi and soon to come also Java.

Look at www.eldermage.com and see what it can do.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games

This topic is closed to new replies.

Advertisement