Questions about Java engines for 3D

I’m beginning a project about 3D simulation.

This’s my outline:

  1. My project’ll be written in Java
  2. My project’ll have some 3D viewport (like 3DS)
  3. My project’ll allow user to interact with objects (like CAD)

I’ve had attempts to find some Java 3D engines for my project. First, I found Java3D, but after run some example apps, it seems not so good (slow and it has many new concepts as in the tutorial, maybe because I’m familiar to native GL). Next, I found gl4java, it’s fine, nothing seems difficult, but unfortunately it’s dead. Finally, I found jogl… and some engines (YAJOGLB, Xith3D, jME…), but jogl doesn’t seem mature, the future of it seems vague, and neither the others do.

So, now I’m so confused:

  1. What engine should be suitable to my project?
  2. Is Java3D really good? I’ve no exp about it, but it seems too tough to dig in.
  3. Should I write Java apps and run openGL independently (through JNI)? It seems not good for interative apps (like CAD or 3DS).
  4. Can I create multi viewports app with jogl, jME…? (I think I can, but I failed on the first time trying this with jogl, I don’t know what’s going on, the app compiled and ran but nothing created, it work well when I remove glCanvas)

I think I like jogl, but like I said “a little confused”
Thank for your helps

http://javagamesfactory.com/tech.html

Use LWJGL (most stable) or JOGL (most identical to C syntax) if you want raw OGL. JOGL is significantly less stable than LWJGL (or seems so :() but it’s really not bad - and it’s a hell of a lot better than gl4java ever was!

But most people are better off using a scenegraph, in which case use Xith3d or jME. From your description I suspect an SG is of little or no use to you, especially since you already know OGL?

The first thing you should consider when choosing a external API is your goals with the project; to learn GL, to learn basic 3D, have fun or make a great application etc. When your priorities are set you should start from there.

I’d say that in 90% of the time, if your goal is not to just learn OpenGL, you are better of with a scenegraph. Java scenegraphs worth considering are AgentFX, JME and Xith3D I guess.

Xith3D is purely a scenegraph if I’m not mistaking. The API is based upon the Java3D API, but without thread safety. So if you like Java3D and want more speed you probably love Xith3D. Standard plug-in is based upon JOGL and should integrate fairly well with SWING. Xith3D offers you a good scengraph, nothing more or nothing less.

JME is more of a high-level toolkit. What I have seen it more resembles a game/graphic engine with a scengraph structure but I might mistaking. It seems to offers a fairly extensive toolkit. I don’t know that much about JME but I believe that the (the standard plugin) is based upon lwjgl. Which might make it hard to integrate it with SWING if that is a priority?

The AgentFX engine consists of 2 modules, a rendering engine (com.agency9.render.) and a high-level feature-rich game oriented API (com.agency9.agentfx.). The standard plug-in is based upon JOGL so it integrates fairly well with SWING

The high-level system is created for rapid development of virtual environments. It gives a developer every thing he/she needs to control a world. You got bone animation, collision detection, live dynamic lights, shadow volumes etc. A scene can be loaded directly from .obj file without any preprocessing and everything runs smoothly.

The rending system is a state based scene graph that allows you to do practically everything that is possible to do in a system such as OpenGL or DirectX. The rendering system has been designed to ease the development of new rendering algorithms. Since the system is object oriented it is very easy to extends objects and give them properties such as flickering light, animated textures etc.

I belive that there is a tutorial in the AgentFX doc showing who to setup 3D viewport. You can find AgentFX at: www.agency9.se

Xith3D and JME are free.
AgentFX is commercial but available for free under a PLE license.

Have fun
// Tomas :slight_smile:

Note! I’m involved in AgentFX so I am biased, but I’ve tried to objective.

First, I’d thank for all advice.
My project doesn’t mainly focus on 3D, I think “3D” is about ~30% of my project, and I’d like to embed it in Swing or Applet (for further purposes).

Thank to blahblahblahh, I’ve had a day to try LWJGL, on my opinion LWJGL is just a simple way to use openGL in Java, it just mapping native openGL functions to Java functions, it only create a GL window and it doesn’t seem compatible to Swing nor Applet nor SWT… (may be they aim to game only)

Thank to Tomas, actually I have some exp on openGL (from nehe.gamedev.net), my aim is to make an simulation app, so I need a sence to draw sth reality, and maybe some sences for the users’ inputs. I have no experience on sencegraph. But actually, I have read some pages of Java 3D Tutorial (it seems too old and not attractive too ::slight_smile: - tutorial’s compatible to J3D 1.2), and it made me so confused wiht many new convetions without a real example (maybe I can’t stand waiting the examples), and a little unsatisfied, it always loads my CPU 100%, when I run it’s example.

I took a look at AgentFX™ 2, it sounds good. Um…, it seem the only J 3D engine has commercial license, but it seems there’re too few people are interested in it.

Tomas, have you had any exp on aFX? on your point of view, what do you think about aFX (it’s design, it’s speed, it’s speed in design, will it load CPU 100%)? why people’re not interested in it? what’s about it’s future? Can aFX run well with Swing, Applet,…

Now, I’d better dig in Xith3D not jME (I dont’ like monkey ;D, just kidding…), but I’d like to use aFX, it looks professional

Thank for your helps…

;D sorry Tomas, it seems that you are the admin of agency 9

[quote] sorry Tomas, it seems that you are the admin of agency 9
[/quote]
I’m the designer of the API ;D . So that was why added the note about being biased.

[quote] I took a look at AgentFX™ 2, it sounds good. Um…, it seems the only J 3D engine has commercial license, but it seems there’re too few people are interested in it.
[/quote]
Well, the low interest is mainly in this forum since it’s seems that the majority of the developers are hobbyist. So a commercial engine probably isn’t there first priority.

[quote] Tomas, have you had any exp on aFX? on your point of view, what do you think about aFX (it’s design, it’s speed, it’s speed in design, will it load CPU 100%)?
[/quote]
I totally depend on what you are trying to do. It’s all a matter of content. You could easily(with a talented team :wink: ) develop a game with the quality of Doom3, but then it would need the same amount of horsepowers as Doom3. But on the other hand you could as easily develop an app doesn’t any horsepowers… it is all up to you.

[quote] why people’re not interested in it?
[/quote]
It’s just in the community space. We currently have several commercial cutomers, but most are not within the game scene.

[quote] what’s about it’s future?
[/quote]
I’d say excellent ;D But then again I’m biased. We are making money, have been around longer that both Xith3D, JME, JOGL and LWJGL. We also have a set of exiting releases the coming month, starting next week. More on that later, but for now you can look at:

http://www.agency9.se/developer/community/viewtopic.php?t=8

[quote] Can aFX run well with Swing, Applet,…
[/quote]
Swing yes, applets no… but then again if a customer asks it might happen :wink:

// Tomas :slight_smile:

Actually, Swing and SWT support is in from v0.8 and above. And yes, at the moment only LWJGL is supported, but integration with JOGL is in progress (almost done if I’ve understood it correctly).

Thank u, Tomas. I’m really interested in aFX and looking forward to reviewing it’s next release (15th Jan, it seems to be a great release with many functionalities) :D.
But it’s commercial license really makes me unpleased :’(. Could it’s a possible way to make it easier???

Now, I’m trying on sg and Xith3D, I dont know much about it but hopefully, it’s suitable to my plan. Thanks all

By the way, I 've a question: my CPU always loads 100% in almost 3D in Java examples , very simple examples like setup a 3D screen, draw a cube (with almost engines, maybe except jogl, gl4java). It makes me so confused to use 3D in Java.

100% CPU is usually caused by a frame-rate capper. It’s a benign Thread.yield() loop, so it’s not actually using the CPU at all, it just looks like it.

Cas :slight_smile:

[quote]But it’s commercial license really makes me unpleased :’(. Could it’s a possible way to make it easier???
[/quote]
Along with the new release January 15 we’ll announce a new pricing model to make it easier for small developers to take advantage of AgentFX. The PLE license will be available for non-commercial use. Hopefully we’ll manage to rewrite the EULA till January 15… else it will be updated soon :slight_smile:

I’ll add in an Advertisement for our scene graph - Aviatrix3D. Unlike the other API’s mentioned so far, it is not designed for gaming. Instead, the focus is on visualisation, CAD and other higher-end tasks. It’s built over the top of JOGL and completely extensible, so if you do need to get down in the weeds for some custom rendering task, you can. There’s a few file format loaders for it, and a few more currently in development. See the links in my sig for more info.

[quote]Unlike the other API’s mentioned so far, it is not designed for gaming.
[/quote]
AgentFX version 1.x was designed for gaming but since the release of new the 2.x platform that has changed a bit.

The first package, com.agency9.render. * is pure scenegraph. Its design differs from other scenegraphs such as Java3D. The render package has been developed for the purpose of rapid development of graphic algorithms, be it gaming, medical or industrial. Unlike other other scenegraphs you know the exact order of rendering, and can sort on every state. The entire pipeline is also integrated with Cg which means that you can virtualy access everything from a shader without. We/customers have used this system to do everything from shadow volumes, refelection to flow vizualtizations and bumpmaps.

The second package, com.agency9.agentfx is high-level system created for rapid development of virtual environments. It is built with the tools provided by render. You could say that this is more game oriented, but still very general purpose.

So you could say that AgentFX is rapid development environment for demanding graphic algorithms and virtual environments/gaming.

// Tomas :slight_smile:

[quote]100% CPU is usually caused by a frame-rate capper. It’s a benign Thread.yield() loop, so it’s not actually using the CPU at all, it just looks like it.

Cas :slight_smile:
[/quote]
It’s actually load my CPU 100% and actually makes it hotter n’ hotter. Have anyone had any solution for this situation?

After days trying on Xith3D, I’ve some exp about sg, n’ decided that sg’ll be suitable to my project. But I will not use X3D due to poor Swing, not Applet, and some uncomfortable exceptions.

My priority is not “how fast the engine can render”.
My aim: “first the stable of the engine, second the convenience (load, colliion, etc.), third the future of the engine”

Now, my choices are, maybe Java3D (Swing and Applet supported) for the cases of using sg for user interaction, n’ lwjgl for the cases of fast drawing simulation.

But, I’ll try aFX especially it’s next release (tomorrow). Hopefully, it could be a part of my project ::slight_smile: (about noncontinuous wave).

and I’ll also try Aviatrix3D as someone advised.

By the way, I’ve some questions:

  1. MATHLAB is written in Java, do anyone know what kind of engine it used?
  2. When we load an objects from files (exp: 3DS or OBJ), can we manipulate with it (it’s each triangle)?

Thank you guys…

You could also have a look at JPCT: http://www.jpct.net/
It’s a 3D game engine which can render in both software and hardware, and when using the sw renderer you can use applets too.

The AgentFX 2.1 release is out :slight_smile: