Create a shape above the shape using java3d

Let's say I drew a cube or cylinder with Java3d. I would like, for example, when I click on the surface of these figures to build a small cone above it. I would be grateful if there are examples. thank

+3
source share
1 answer

Well, I don't have a special code for you, but you can add an action listener to the cube. then with a serperate class with code for the cone. This is not all the code, but it should serve as 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
source

Source: https://habr.com/ru/post/1783299/


All Articles