
|
Mobile Java Download MIDlet and source code>>
To use different textures on the cube we must have an appearance for each side of the cube.
Appearance []appearance = new Appearance[6];
for(int i=0; i<appearance.length; i++){ appearance[i] = new Appearance(); appearance[i].setPolygonMode(polygonMode); mesh.setAppearance(i, appearance[i]); } So, to change the texture we can do something like this:
Appearance f,t,b;
f = appearance1; // front
t = appearance3; // top b = appearance4; // bottom f.setTexture(0, texMenu[front]); t.setTexture(0, texMenu[top]); b.setTexture(0, texMenu[bottom]); | |||
Copyright © 2001 - 2009 Sony Ericsson Mobile Communications AB. All Rights Reserved.