开发者

Build a shape over a shape with java3d

开发者 https://www.devze.com 2023-02-02 12:21 出处:网络
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 th

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


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
    }
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号