Java 3D Canvas 到虚拟世界的映射

发布于 2024-09-07 07:13:27 字数 353 浏览 1 评论 0原文

我设置了一个 3d 场景,可以导航我的场景等(我在 Java 3D 方面相当有经验),但我仍然需要方法在 Java 3D 中实现以下四个操作:

  • 将 Canvas3D 的查看区域映射到虚拟世界(使用这个映射我应该能够在观看画布周围的虚拟世界中绘制轮廓(矩形)。
  • 从画布上的鼠标点转换为虚拟世界中的点(如果我有这个,我也应该能够实现上述目标)
  • 从虚拟世界中的点转换为
  • 我想要的 Canvas3D 对象上的点能够缩放我的场景以适应 Canvas3D 对象的查看区域(希望没有反复试验。即,希望不要放大一点,然后再次测试点,然后重复)

以上所有内容都非常密切相关,因此任何帮助将不胜感激。

I have a 3d Scene set up and can navigate my scene etc (I am fairly experienced in Java 3D) but i still need ways to achive the following four operations in Java 3D:

  • map the viewing area of my Canvas3D into the virtual world (with this mapping i should be able to draw an outline (rectangle) in the virtual world around the viewing canvas).
  • translate from a mouse point on the canvas to a point in the virtual world (if i have this i should also be able to achieve the above objective)
  • translate from a point in the virtual world to a point on the Canvas3D object
  • i want to be able to zoom my scene to fit into the viewing area of the Canvas3D object (hopefully without trial and error. Ie. hopefully without zooming in a little, then testing points again, then repeating)

All of the above are very closely related so any help would be greatly apreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半世蒼涼 2024-09-14 07:13:27

要将 Canvas3D 坐标转换为虚拟世界坐标,您应该使用 getVworldToImagePlategetImagePlateToVworld Canvas3D 的方法。这将为您提供从 imagePlate 坐标到虚拟世界坐标的映射。

要将像素位置转换为虚拟世界坐标,您需要将上述转换与 getPixelLocationInImagePlate

上述相反,getPixelLocationFromImagePlate,将回答你的第三点。

一旦您将所有内容都放在同一坐标空间中,您就可以开始找出特定应用程序所需的正确转换。

To convert from Canvas3D coordinates to Virtual world coordinates, you should use the getVworldToImagePlate and getImagePlateToVworld methods of Canvas3D. That will get you a mapping from imagePlate coordinates to virtual world coordinates.

To convert a pixel location to virtual world coordinates, you need to chain the above transform with the return from getPixelLocationInImagePlate

The reverse of the above, getPixelLocationFromImagePlate, will answer your third point.

One you have everything in the same coordinate space, you can start figuring out the proper transformations that you need for your specific application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文