简体   繁体   English

JCanvas3D和Canvas3D

[英]JCanvas3D vs Canvas3D

Can anyone please tell me the issues that we face when using JCanvas3D instead of Canvas3D? 谁能告诉我使用JCanvas3D而不是Canvas3D时遇到的问题?

How to achieve transparency using JCanvas3D? 如何使用JCanvas3D实现透明度?

Regards, hariprasad 问候,hariprasad

The only reference to JCanvas3D I can find right now is in a com.sun.j3d.exp.swing package. 我现在可以找到的对JCanvas3D的唯一引用是在com.sun.j3d.exp.swing包中。 The API for that package actually has an EXPERIMENTAL warning on it. 该程序包的API实际上上面有一个EXPERIMENTAL警告。 That being said, the forums still have quite a bit of activity in them and it sounds as though people are still actively working on the code. 话虽如此,这些论坛中仍然有很多活动,听起来好像人们仍在积极地编写代码。

The distinguishing feature between these two seems to be that Canvas3D is the standard "AWT"-like heavyweight component and JCanvas3D is meant to be its Swing counterpart. 两者之间的区别似乎是Canvas3D是标准的“ AWT”类重量级组件,而JCanvas3D则是它的Swing对应组件。

After searching around a bit more: I found this tidbit quoted from an answer by interactive mesh which sounds like it will answer your more specific question. 经过更多的搜索之后:我发现此花絮来自交互式网格的答案,听起来像它将回答您更具体的问题。

A transparent scene background is available for all lightweight 3D canvases (JCanvas3Dxyz, FxCanvas3Dxyz). 透明场景背景可用于所有轻量级3D画布(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 scene background area so that the panel's own background color shows up. 将Java 3D系统属性“ transparentOffScreen”设置为true(-Dj3d.transparentOffScreen = true或System.setProperty(“ j3d.transparentOffScreen”,“ true”))会导致场景背景中所有像素的alpha值均为'0'区域,以便显示面板自己的背景色。 When switching its opaque attribute to false the parent panel will be rendered in the scene background area. 将其opaque属性切换为false时,父面板将在场景背景区域中呈现。

This allows - to create a fancy background or - to move the 3D scene content across all panels within a JFrame or - to create layered 3D scenes. 这允许-创建精美的背景,或-在JFrame内的所有面板上移动3D场景内容,或-创建分层的3D场景。

The scene background area within a Canvas3D is always opaque. Canvas3D中的场景背景区域始终是不透明的。

-August -八月

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM