Login  Register

Re: Simple question: How to set a different image to each side of a 3D cube?

Posted by gouessej on Nov 26, 2014; 8:49pm
URL: https://forum.jogamp.org/Simple-question-How-to-set-a-different-image-to-each-side-of-a-3D-cube-tp4033645p4033646.html

Hi

Do that:
((Shape3D)getChild(TOP)).setAppearance(ap0);
((Shape3D)getChild(LEFT)).setAppearance(ap1);
((Shape3D)getChild(RIGHT)).setAppearance(ap2);
((Shape3D)getChild(FRONT)).setAppearance(ap3);
((Shape3D)getChild(BACK)).setAppearance(ap4);
((Shape3D)getChild(BOTTOM)).setAppearance(ap5);

You should have looked into the source code, it was easy to guess. Java3D is open source, people should look at the documentation and the source code before asking any question here:
https://github.com/hharrison/java3d-utils/blob/master/src/classes/share/com/sun/j3d/utils/geometry/Box.java#L287
Julien Gouesse | Personal blog | Website