Canvas3D and Swing

This question is about a performance issue on Mac OS X

The Canvas3D object is embedded in the JPanel; then the panel integrates with the rest of the Swing-built application. Inside this canvas, I am making a simple cube, applying some transformations. On initial launch, it works fine. But when I try to resize the window or do some operations with the vertical or horizontal buttons of the layout bar. The components on the screen take a certain amount of time. First comes a flashy white thing, then will swing components appear? (Fully utters a shimmery kind of thing). Are there any solutions to this problem?

Please help me in this regard.

J3DSwinger

+1


source to share


2 answers


If you're having trouble with the default rendering Canvas3D

, you should try offscreen rendering, double buffering, and active rendering using a timer. I would close rendering at some reasonable fps.



+1


source


Java3D 1.5 now includes a JCanvas3D component in an experimental package that does offscreen rendering, double buffering, and other things necessary for Java3D to play in the Swing GUI.



See com.sun.j3d.exp.swing.JCanvas3D

+1


source







All Articles