使用 java3d 在形状上构建形状

发布于 2024-10-10 08:06:33 字数 80 浏览 0 评论 0原文

假设我用 Java3d 绘制了一个立方体或圆柱体。例如,我想当我单击这些形状的表面时在其上构建一个小圆锥体。如果有一些例子,我将不胜感激。 谢谢

Lets say I have drawn a cube or a cylinder with Java3d. I would like to for example when I click on the surface of these shapes to build a small cone over it. I would appreciate if there is some examples.
thanks

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

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

发布评论

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

评论(1

梦中楼上月下 2024-10-17 08:06:33

好吧,我没有适合您的特定代码,但您可以向多维数据集添加一个操作侦听器。然后是一个带有圆锥体代码的锯齿状类。这不是完整的代码,但它应该提供一个很好的示例。

public void class random1 {
cube.addactionListener(this);
} 
public void actionlistener(ActionEvent ev)
if(ev.actionEvent = cube){
Random2 rad = new Random2();
rad.cone();
 }
 }

 public void class Random2 {
    public void cone(){
      // code for the cone has to be in here
    }
 }

Well i dont have a specific code for you but you could add a action listener to the cube. then with a serperate class with the code for a cone. This is not the entirety of the code but it should provide a good example.

public void class random1 {
cube.addactionListener(this);
} 
public void actionlistener(ActionEvent ev)
if(ev.actionEvent = cube){
Random2 rad = new Random2();
rad.cone();
 }
 }

 public void class Random2 {
    public void cone(){
      // code for the cone has to be in here
    }
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文