participate


JavaFX General - JavaFX 3D powered by Java 3D !
<<   Back to Forum  |   Give us Feedback
This topic has 17 replies on 2 pages.    1 | 2 | Next »
InteractiveMesh
Posts:47
Registered: 4/18/07
JavaFX 3D powered by Java 3D !   
Mar 16, 2009 1:35 AM

 
Hi,

enter the Virtual Universe now.

Add 3D models, animations, and interactions to your JavaFX Scene via a resizable JavaFX SwingComponent and create 'Filthy Rich Internet Applications'.

See "Java 3D meets JavaFX“ on java.net for more implementation details
http://forums.java.net/jive/thread.jspa?threadID=56033&tstart=0

and the corresponding web page for downloads and samples
http://www.interactivemesh.org/testspace/j3dmeetsjfx.html

August
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Apr 17, 2009 6:27 AM (reply 1 of 17)  (In reply to original post )

 
Hi,

a third sample program is now available (early access): FXPropellerPuzzle. The Java 3D scene of an animated propeller engine is rendered into several puzzle pieces. The puzzle board is resizeable from 2x2 up to 8x8 pieces on a screen of 1200 pixels height. This application is using source code of the JavaFX sample 'PuzzlePieces'.

See http://www.interactivemesh.org/testspace/j3dmeetsjfx.html

Blogs about JavaFX and 3D:

- Anatoli Fomenko: http://www.javafxblog.net/
- Jim Weaver: http://learnjavafx.typepad.com/weblog/

August
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
May 29, 2009 10:29 AM (reply 2 of 17)  (In reply to original post )

 
Hi,

the source code of the sample program FXPropellerPuzzle and for the underlying FXCanvas3DImage API are now available for download. Following changes were made to solve the issues:

- Picking and dropping of puzzle pieces now (should) respond with no delay. The functions Node.toBack()/toFront() for sequence members were replaced by

package function pieceToFront(piece: PuzzlePieceComponent): Void {
    delete piece from puzzleGroup.content;
    insert piece into puzzleGroup.content;
}
 
package function pieceToBack(piece: PuzzlePieceComponent): Void {
    delete piece from puzzleGroup.content;
    insert piece before puzzleGroup.content[0];
}


- To adjust the number of puzzle pieces according to a new size of the puzzle board missing pieces now are added resp. surplus pieces are removed. Replacing all pieces by a new sequence was more time-consuming.

- The shuffle and solve animations seem to run a little faster, but they still might be slow for more than 7x7 pieces.


Inspired by the JavaFX sample 'VideoCube' I started a new feature and a new sample program FXTuxInTheBox. Six simultaneous views into a Java 3D box are assigned to six JavaFX faces which build the shape of a box by applying the JavaFX effect PerspectiveTransform. The underlying FXCanvas3DMV API supports multiple views into Java 3D scenes. An 'early access' version can be launched at http://www.interactivemesh.org/testspace/j3dmeetsjfx.html

August
 
DiegoBenna
Posts:42
Registered: 2/9/09
Re: JavaFX 3D powered by Java 3D !   
May 30, 2009 2:58 AM (reply 3 of 17)  (In reply to #2 )

 
And javafx with java OpenGL what do you think? OpenGL are the best graphics libraries.
 
phoneserviceproviders Click to block this message from display
Posts:4
Registered: 6/8/09
Subject blocked   
Jun 7, 2009 10:27 PM (reply 4 of 17)  (In reply to #3 )





 
User/Message blocked
 
maennj
Posts:50
Registered: 4/3/09
Re: JavaFX 3D powered by Java 3D !   
Jun 7, 2009 10:58 PM (reply 5 of 17)  (In reply to #3 )

 
I see jogl.jar in javafx desktop libraries folder. So I think they are integrating some 3D behind the scene ;)
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Jun 8, 2009 9:50 AM (reply 6 of 17)  (In reply to #3 )

 
Thoughts about JavaFX 3D Rendering

JavaFX 1.2 doesn't provide a script-language-based and hardware-accelerated 3D API. Neither in the FAQ nor at JavaOne 2009 any announcements were made. Concerning 'JavaFX Prism' no details are available yet. Early in 2008 Sun interrupted their contributions to the Java 3D API for the JavaFX 3D Scene Graph (SG3D at JavaOne 2008). There are rumors that it will be released this year, or later.

If 3D support is now needed or desired in JavaFX, an alternative might be integrating one of the lower or higher level 3D Java APIs. Lower level Java APIs are JOGL (Java binding for OpenGL) and LWJGL (Lightweight Java Game Library). Higher level scene-graph-based Java APIs are: Ardor3D (fork of jMonkeyEngine), Aviatrix3D, Java 3D, jMonkeyEngine, JUniversal3D (fork of Java 3D), and Xith3D. All of them do 3D rendering at least per OpenGL. Java 3D and JUniversal3D render per DirectX/Direct3D, too.

The most common 3D rendering target is a heavyweight component derived from 'java.awt.Canvas'. This is the fasted Java GUI component available. Unfortunately, JavaFX doesn't support heavyweight components in its scene. So, 3D Java APIs have to provide a lightweight component for 3D rendering. This can be added via a SwingComponent to the JavaFX scene.

As InteractiveMesh is also committed to Java 3D and its fork JUniversal3D, it was and is a challenge to make current and future Java 3D applications runnable under JavaFX as they are runnable under Java/Swing and Eclipse/SWT. But, it looks as if no other 3D community has published a JavaFX 3D application powered by their 3D API so far. Am I right?

Lightweight 3D rendering is not as fast as 3D on-screen rendering by a heavyweight canvas, because in lighweight 3D rendering all pixel data have to do a round-trip GPU -> CPU -> GPU instead of to be drawn directly into the display.

JOGL's lighweight component 'javax.media.opengl.GLJPanel' provides an actually faster alternative: direct rendering into a Java 2D back buffer (Swing back buffer ?) to avoid the round-trip. But this is declared highly experimental and isn't available as public java- or javax-classes.

Therefore, I'm curious if JavaFX will provide high speed back buffer 3D rendering and if this will be available for Java applications as well.

August


JavaOne 2008 https://java3d.dev.java.net/j3dbof08/j3dbof08.pdf
JavaFX Prism http://forums.sun.com/thread.jspa?threadID=5390242&tstart=30
JOGL https://jogl.dev.java.net/
LWJGL http://lwjgl.org/
Ardor3D http://www.ardor3d.com/content/
Aviatrix3D http://aviatrix3d.j3d.org/
Java 3D https://java3d.dev.java.net/
jMonkeyEngine http://www.jmonkeyengine.com/
JUniversal3D http://forums.java.net/jive/thread.jspa?messageID=318600&#318600
Xith3D http://xith.org/
 
chebetos
Posts:1
Registered: 6/9/09
Re: JavaFX 3D powered by Java 3D !   
Jun 9, 2009 2:04 AM (reply 7 of 17)  (In reply to #6 )

 
Hi, when do FXCanvas3D support JavaFX 1.2?
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Jun 9, 2009 10:56 AM (reply 8 of 17)  (In reply to #7 )

 
Three of four samples are now ported to JavaFX 1.2 and available for launch and download. The Java APIs FXCanvas3D and FXCanvas3DImage are not affected and their current releases can still be used.

August
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Jun 18, 2009 1:38 AM (reply 9 of 17)  (In reply to #6 )

 
Thoughts about JavaFX 3D Rendering (continued)


paulby, someone who should be informed, says:

"The 3D UI planned for FX is for simple visual effects and there are no plans (that I am aware of) to create a fully featured 3D renderer for FX."

java.net.Forums: Wonderland & MPK20 Interest, Thread 'Wonderland + JavaFX', 2009/06/17, http://forums.java.net/jive/thread.jspa?threadID=63236

August
 
renanse
Posts:1
Registered: 7/10/09
Re: JavaFX 3D powered by Java 3D !   
Jul 10, 2009 8:24 PM (reply 10 of 17)  (In reply to #9 )

 
Ah, it's such a shame that the 3d accelerated version of JavaFX was thrown out for what seems (to me) like political reasons. From what I saw it was well on its way and had really great promise. :(
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Aug 19, 2009 8:53 AM (reply 11 of 17)  (In reply to original post )

 
Hi,

- Faster JavaFX 3D rendering

A different approach to synchronize Java 3D and JavaFX rendering can now be tested with the sample program FXCharacterCube SB 4.0. A more serialized graphics device access of both pipelines reduces the time-consuming native 3D context switches. In addition, the two off-screen buffers can be replaced by a single one. This saves the time it takes to copy the buffer data.

Even if the public APIs of Java 3D and JavaFX provide only limited or no rendering callbacks the above mentioned approach results in a faster running rendering loop in comparison to the current FXCanvas3D API 2.0.

- Stereoscopic JavaFX 3D rendering

Anaglyphic motions or images provide a stereoscopic 3D effect when viewed through colored filters. Java 3D's off-screen rendering and left/right eye viewing capabilities allow real time stereoscopic 3D rendering on every CRT or LCD monitor. Only anaglyphic glasses with red-cyan filters (left-right) are needed to see the stereoscopic 3D effect.

The Java 3D Swing based stereoscopic API was ported to JavaFX: FXCanvas3DAnaglyph. The sample program FXTuxInStereo allows to switch from stereoscopic to monoscopic viewing. When rendering is in monoscopic mode the prototype of the new single buffer FXCanvas3D API is used.

See also the Java 3D forum thread 'JCanvas3D Anaglyph provides stereoscopic 3D rendering' for more details and helpful links: http://forums.java.net/jive/thread.jspa?threadID=60914

- Multiple simultaneous views

Sources, apidoc etc. of the multiple views API FXCanvas3DMV and the corresponding sample program FXTuxInTheBox are now available for download.

See http://www.interactivemesh.org/testspace/j3dmeetsjfx.html

August
 
sancelot
Posts:10
Registered: 8/21/06
Re: JavaFX 3D powered by Java 3D !   
Sep 14, 2009 1:51 AM (reply 12 of 17)  (In reply to #11 )

 
I had a look a these samples, however, I do not understand why a separated thread is needed to update the 3d view ?

I would only need calling a 3d update func on request in my java/fx app .

My questions may be silly, but take it easy, I am very new to java/javafx , but and advanced programmer in c/c++ and opengl
 
InteractiveMesh
Posts:47
Registered: 4/18/07
Re: JavaFX 3D powered by Java 3D !   
Sep 16, 2009 3:51 AM (reply 13 of 17)  (In reply to #12 )

 
Hi sancelot, thanks for your source code analysis and interesting question.

- Neither the Java 3D/JavaFX sample programs nor the underlying lightweight canvas APIs create new threads for 3D rendering tasks. However, they are dealing with existing threads of the Java, Java 3D, and JavaFX implementations via Locks and Conditions.

- JavaFX is a single-threaded engine. User actions, animations, and rendering run in a sequential manner controlled by the EDT (Java's core Event Dispatching Thread).

- The (almost) GUI-independent engine of the scene-graph-based Java 3D API is heavily multi-threaded. Its master thread MasterControl takes care of the central message dispatch and thread scheduling (state updates, animations, rendering). In its J3D-Renderer thread all OpenGL calls regarding the off-screen rendering loop are done per JNI (Java Native Interface). No calls are executed under the EDT. The OpenGL pixel buffer (pbuffer) is copied into a BufferdImage object by calling glReadPixels(..). Now it is up to the lightweight canvas API to initiate the repainting of the corresponding GUI-component.

- So, Java 3D does not render in response to a special JavaFX request. But, vise versa Java 3D requests JavaFX to repaint. As reading and painting of the rendered pixels have to be executed one after the other the J3D-Renderer thread and JavaFX' EDT have to be synchronized.

August

Edited by: InteractiveMesh on Sep 16, 2009 3:51 AM
 
sancelot
Posts:10
Registered: 8/21/06
Re: JavaFX 3D powered by Java 3D !   
Sep 16, 2009 8:28 AM (reply 14 of 17)  (In reply to #13 )

 
August,
Thanks for the answer,

I think your work regarding 3d and javafx seems to be the right way to go today.

however, Can you please provide me the very basic demo code that integrates only a very basic cube in a 3d canvas in javafx (I think I need implementation of FXCanvas3DImage ?)

I tried to compile and run tuxinthebox demo, but failed at runtime with javafx 1.2

Best Regards
Steph
 
This topic has 17 replies on 2 pages.    1 | 2 | Next »
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 25
  • Guests : 132

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums