简体   繁体   English

如何在Java的“框架”面板中显示,缩放3D多维数据集?

[英]How to display, zoom cubes in 3D, in Java's Frame's panel?

I need to be able to display a scene... : 我需要能够显示一个场景...:

  1. Containing N cubes (with precise width, height and depth : each in the shape of "-/+[0|1|2].[0|1|...|9]+" - with seven digits after the comma : need a displaying with high-precision), with a given color (the same on all the faces of the cube) 包含N个立方体(具有精确的宽度,高度和深度:每个立方体均为“-/ + [0 | 1 | 2]。[0 | 1 | ... | 9] +”的形状- 逗号后七个数字) :需要具有给定颜色(在多维数据集的所有面上都相同)的高精度显示)

  2. I must be able to overlay a cube colored with white with another cube colored with red, of the same width, height and depth (of course, with same coordinates X, Y and Z) and the latter must hide the first without any problem of Z-fighting 我必须能够将白色的多维数据集与另一个红色,具有相同宽度,高度和深度(当然,具有相同的X,Y和Z坐标)的多维数据集覆盖在一起, 并且后者必须隐藏第一个没有任何问题。 Z战

  3. I have coordinates X, Y and Z to place each cube in the scene 我有坐标X,Y和Z将每个立方体放置在场景中

  4. I must be able to rotate the entire scene (ie : each cube must rotate/move) 我必须能够旋转整个场景(即:每个立方体都必须旋转/移动)

  5. I must be able to zoom/unzoom in the scene, before or after having rotated the latter 在旋转场景之前或之后,我必须能够在场景中进行缩放/缩放

I don't want to use OpenGL, or something else than the standard Java's API. 我不想使用OpenGL或其他标准Java API。

For the moment, I just display pixels in a 2D JFrame 's panel (with the class Graphics and the overrided paint() ). 目前,我只是在2D JFrame的面板中显示像素(带有Graphics类和重写的paint() )。 But my project makes me in need of switching with a 3D approach. 但是我的项目使我需要使用3D方法进行切换。 I would want to just change my use of Graphics and paint() , and to keep my JFrame 's panel. 我只想更改对Graphicspaint() ,并保留JFrame的面板。

Is it possible? 可能吗? What class do you advice me? 你给我什么课建议?

Consider JavaFX, as shown in Getting Started with JavaFX 3D Graphics . 请考虑使用JavaFX,如JavaFX 3D图形入门中所示。 It uses the platform's available rendering pipeline internally, as discussed in JavaFX Architecture . JavaFX Architecture中所述 ,它在内部使用平台的可用渲染管道。 Several related examples are shown here . 这里显示几个相关示例。 If you stay with Swing, you can embed JavaFX content using JFXPanel , seen here . 如果你留在摇摆,你可以嵌入使用JavaFX内容JFXPanel ,看到这里 In particular, you can test overlap with this example . 特别是,您可以使用此示例测试重叠。

图片

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

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