简体   繁体   English

如何在Java 3d中显示Sphere的坐标

[英]How to display coordinates of Sphere in Java 3d

I have a universe containing a lots of Sphere objects with different colors placed in different locations. 我有一个Universe,其中包含许多放置在不同位置的具有不同颜色的Sphere对象。 What I need to do now is to find a way to display the coordinates of the center of a sphere when clicking on it with the mouse, so that the user is going to be able to retreive this data in a user-friendly way. 我现在需要做的是找到一种方法,用鼠标单击时显示球心的坐标,以便用户能够以用户友好的方式检索此数据。

Is there someone who has an idea on how to do that? 是否有人对此有想法?

I assume you are wanting to retrieve the 3D coordinates of the Sphere. 我假设您要检索Sphere的3D坐标。 The most obvious solution is to define your own location-storing object [ xyz]. 最明显的解决方案是定义您自己的位置存储对象[xyz]。 Keep a copy of the location whenever your program is first creating a Sphere. 每当您的程序第一次创建Sphere时,请保留该位置的副本。

Are you using this pre-defined Sphere?: 您是否正在使用此预定义的Sphere?

com.sun.j3d.utils.geometry.Sphere com.sun.j3d.utils.geometry.Sphere

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

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