JCanvas3D vs Canvas3D

Can anyone please tell me about the problems we are facing when using JCanvas3D instead of Canvas3D?

How to achieve transparency with JCanvas3D?

Regards, Hariprasad

+1


source to share


1 answer


The only JCanvas3D reference I can find right now is in the com.sun.j3d.exp.swing package. The API for this package actually has an EXPERIMENTAL warning. However, there is still quite a lot of activity in the forums and it seems that people are still actively working on the code.

The distinguishing feature of the two seems to be that Canvas3D is a standard "AWT" -like heavyweight component, and JCanvas3D should be its Swing counterpart.



After searching for a bit more: I found this tidbit listed in the answer for an interactive grid that seems to answer your more specific question.

Transparent background of the scene available for all lightweight 3D canvases (JCanvas3Dxyz, FxCanvas3Dxyz). Setting the Java 3D system property "transparentOffScreen" to true (-Dj3d.transparentOffScreen = true or System.setProperty ("j3d.transparentOffScreen", "true")) results in an alpha value of '0' for all pixels in the background scene scene so that own background color appears. when toggling its opaque attribute to false the parent panel will be displayed in the background area of ​​the scene.

This allows you to - create a fancy background, or - move the content of the 3D scene across all panels in the JFrame, or - to create multi-layered 3D scenes.

The background area of ​​the scene inside Canvas3D is always opaque.

-August

+1


source







All Articles