Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX 8 as 3D game engine?

I want to create an MMO 3D game and im looking for a 3D-Engine and my question is about javaFX 8, can i use it for render a lot of 3D cube, models and animation without lose performance or is best to use the lwjgl?

the final question is: javaFX 8 can be used as a 3D engine?

like image 377
Emax Avatar asked Dec 14 '22 23:12

Emax


2 Answers

To answer your questions:

Can i use it for render a lot of 3D cube, models and animation without lose performance?

This has for many people (I think) been a question ... and while there is no clear cut answer, there are ways to make it work.

For example I had recently built a simple Cloth-Simulator, (first Spheres for vertices, then an actual TriangleMesh) at first I took the approach of using an AnimationTimer for my update loop, it worked, but only up to a certain range of calculations.

My second approach was to create a Timer, using ScheduledService at a fixed timeStep interval and setting it to update the UI on completion.

I was able to almost double the number of vertices before performance started to sway. Which was quite an improvement, as I was able to have 20k vertices (not that I recommend it).

You can see the results here on youtube:

ProtoType 1

ProtoType 2

Finished MeshView

So really it is all a matter of how much time you wish to spend creating solutions.

Can javaFX 8 can be used as a 3D engine?

Once again, it really all depends on how much time you want to spend developing the framework. I have personally been trying to build a tool-set for this very purpose, not every thing pans out, but the journey is half the solution.

If you're interested in seeing my approach with the Cloth Simulation, you can find all the sources here: F(x)yzLib , as well as many other useful features/shapes etc...

like image 200
jdub1581 Avatar answered Dec 17 '22 13:12

jdub1581


Yes i think JavaFX 8 is fast enough for 3D games but it's not at the cutting edge of current 3D when it comes to shaders. I have been trying to get to grips with it but it lack's a Camera lookAt method like you get in Three.js.

Lwjgl and JMonkeyEngine are the better options for now for Java 3D game development.

like image 32
Allan Avatar answered Dec 17 '22 11:12

Allan