Login  Register

Re: Texture Problems !

Posted by jfpauly on Nov 25, 2014; 9:47am
URL: https://forum.jogamp.org/Texture-Problems-tp4033628p4033630.html

I think I can help you for texturing your Box.
You have access to the different sides appearance with the  setAppearance method of primitives (box, cone,...):
example of code :
if (obj instanceof Box) {
            ((Box) obj).setAppearance(side, univers.currentApp);
        } else if (obj instanceof Cone) {
            ((Cone) obj).setAppearance(side, univers.currentApp);
        } else if (obj instanceof Cylinder) {
            ((Cylinder) obj).setAppearance(side, univers.currentApp);
        } else {
            Toolkit.getDefaultToolkit().beep();
            jLabel1.setText("Object should be a Cone, a Cylinder, or a Box");
        }
where side = Box.BACK (for instance)
and univers.currentApp = the appearance you want for this side
For you, if left is your Box instance you would code : left.setAppearance...
I hope this helps you
Regards
jfp