4

I have an application written in in Java 3D. As Java 3D is now virtually dead I am thinking about converting the code to JavaFX (JavaFX 8 supports 3D objects).

The question is whether it is relatively simple to convert Java 3D code to Java FX code? Are there straightforward counterparts of Java 3D methods in JavaFX or would it be more like a total redesign of the code?

Here is a little list of packages used in the Java 3D code:

  • javax.media.j3d.Alpha;
  • javax.media.j3d.Appearance;
  • javax.media.j3d.Behavior;
  • javax.media.j3d.BoundingSphere;
  • javax.media.j3d.BranchGroup;
  • javax.media.j3d.Canvas3D;
  • javax.media.j3d.GeometryArray;
  • javax.media.j3d.LineArray;
  • javax.media.j3d.PointLight;
  • javax.media.j3d.Shape3D;
  • javax.media.j3d.Switch;
  • javax.media.j3d.Transform3D;
  • javax.media.j3d.TransformGroup;
  • javax.media.j3d.WakeupOnElapsedFrames;
  • javax.media.j3d.WakeupOnElapsedTime;
  • javax.vecmath.Matrix4f;
  • javax.vecmath.Vector3d;
  • javax.vecmath.Vector3f;

2 Answers 2

3

Java 3D isn't dead, you're completely wrong as you can see here. There is a wide choice of scenegraph APIs more capable than JavaFX 3D API which is particularly poor in my humble opinion.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah we completely agree that the JavaFX 3D API is poor as my post stated. Regarding Java 3D, it's not like anyone is really seriously pushing Java 3D, so I'm not sure how I would be "completely" wrong. For example where are the papers and tech demos at conferences? Nobody has presented a Java 3D tech at JavaOne in like 5 years. Citing your own article as evidence of Java 3D's resurrection isn't enough for me. I'd love to see a revival and modernization of Java 3D, especially if it was merged with JavaFX 3D. But sadly after talking with the Java GUI dev team at Oracle, it won't happen.
Phil is actively pushing Java3D, the Android support will be a huge step forward and he already improved shader support a lot. You focus on "official" things but as far as I know, JOGL and Java3D aren't under Oracle's control for a long time and they have had several releases since 2010. The merge won't happen and we don't mind. Tons of third party libraries live outside of the JDK.
1

I don't know what gouessej is saying about Java 3D not being dead, there will not be feature development for Java3D going forward. However he/she is correct that the base JavaFX 3D API is very lacking in features.

If you want to port your application to JavaFX 3D, you will have to rewrite the rendering portions to match the new JavaFX API. From the list that you provided only PointLight and Shape3D have DIRECT counterparts. Alpha transparency is an undocumented unsupported feature as of 8u40 that will get compiled into the official build for Java 9. The F(X)yz team has a demo of it working just fine but we had to recompile the platform from sources ;-).

You are not alone though, there is now free open source third party support via F(X)yz: (shameless plug....)

http://www.fxyz3d.org

1 Comment

What you wrote is partially wrong, my post has been updated numerous times, I recently added the links to Java3D 1.7.0, the first version of Java3D that is going to support Android. My article has been modified more than 25 times since 2012. The link at the end of your post seems to be broken.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.