Dynamically add textures to ColorCube java3d

I am very new to java 3D and I would like to add texture to ColorCube()

. I found this page:


However, I cannot get it to work, I am not sure how to implement it in my code:

 protected BranchGroup createCube() {
        BranchGroup bg = new BranchGroup();
        bg.addChild(new com.sun.j3d.utils.geometry.ColorCube());
        return bg;


Finally, is it possible to dynamically change this texture?

How do I click a button or load a new texture and change it dynamically?

These are very broad questions, however I am very new to this.


source to share

All Articles