The 'issue' is very small though, but noticable. (see screenshot in attachment)
Since the camera rotates around the 'center', the 'issue' moves from the left leg to the right leg and visa versa.
Well this is my code:
SkinActivity.class (the GameRenderer class in this class only)
class GameRenderer implements GLSurfaceView.Renderer {
final World mainWorld;
final Camera mainCamera;
FrameBuffer frameBuffer;
public GameRenderer(World world) {
this.mainWorld = world;
this.mainCamera = this.mainWorld.getCamera();
}
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
this.frameBuffer = new FrameBuffer(width, height);
totalSkin.hasAlpha();
InnerHead iH = new InnerHead();
OuterHead oH = new OuterHead();
Body b = new Body();
RightArm rA = new RightArm();
LeftArm lA = new LeftArm();
RightLeg rL = new RightLeg();
LeftLeg lL = new LeftLeg();
mainWorld.addObject(iH);
mainWorld.addObject(oH);
mainWorld.addObject(b);
mainWorld.addObject(rA);
mainWorld.addObject(lA);
mainWorld.addObject(rL);
mainWorld.addObject(lL);
this.mainWorld.setAmbientLight(255, 255, 255);
final float dScreen = (float) height/(float)width;
this.mainCamera.setPosition(0, 0.25f, (-9 / dScreen));
this.mainCamera.lookAt(b.getCenter());
iH.translate(0, -2.51f, 0);
oH.translate(0, -2.605f, 0);
rA.translate(-1.5f, 0, 0);
lA.translate(1.5f, 0, 0);
rL.translate(-0.5f, 3f, 0);
lL.translate(0.5f, 3f, 0);
System.runFinalization();
System.gc();
MemoryHelper.compact();
}
@Override
public void onDrawFrame(GL10 gl) {
frameBuffer.clear(new RGBColor(132, 189, 240));
SimpleVector moveLine = new SimpleVector(0.333f, 0, 0.333f);
com.threed.jpct.Matrix m = moveLine.normalize().getRotationMatrix();
m.rotateAxis(m.getYAxis(), (float) -Math.PI / 2f);
mainCamera.moveCamera(Camera.CAMERA_MOVEIN, 10);
mainCamera.rotateAxis(m.invert3x3().getYAxis(),
moveLine.length() / 30f);
mainCamera.moveCamera(Camera.CAMERA_MOVEOUT, 10);
mainCamera.lookAt(mainWorld.getObjectByName("body").getCenter());
final Texture t1 = TextureManager.getInstance().getTexture("bg");
frameBuffer.blit(t1, 0, t1.getHeight(), 0, 0, t1.getWidth(),
-t1.getHeight(), frameBuffer.getWidth(),
frameBuffer.getHeight(), -1, false);
mainWorld.renderScene(frameBuffer);
mainWorld.draw(frameBuffer);
frameBuffer.display();
}
}
Body:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
public class Body extends Object3D {
private static final long serialVersionUID = 8216608860877707087L;
public Body() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-1, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(1, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-1, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(1, 1.5f, -0.5f);
SimpleVector upperLeftBack = new SimpleVector(-1, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(1, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-1, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(1, 1.5f, 0.5f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("bodyfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodyfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodytop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodytop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodyleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("bodyleft"));
this.setTransparency(300);
box.setName("body");
box.build();
}
}
Innerhead:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
public class InnerHead extends Object3D {
private static final long serialVersionUID = 4848178494608221837L;
public InnerHead() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-1, -1, -1);
SimpleVector upperRightFront = new SimpleVector(1, -1, -1);
SimpleVector lowerLeftFront = new SimpleVector(-1, 1, -1);
SimpleVector lowerRightFront = new SimpleVector(1, 1, -1);
SimpleVector upperLeftBack = new SimpleVector(-1, -1, 1);
SimpleVector upperRightBack = new SimpleVector(1, -1, 1);
SimpleVector lowerLeftBack = new SimpleVector(-1, 1, 1);
SimpleVector lowerRightBack = new SimpleVector(1, 1, 1);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("headfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("headfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("headback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("headback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("headtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("headtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("headleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("headleft"));
this.setTransparency(300);
box.setName("head");
box.setSortOffset(9);
box.build();
}
}
Leftarm:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
//biological left :p
public class LeftArm extends Object3D{
/**
*
*/
private static final long serialVersionUID = -5036321054138114930L;
public LeftArm() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);
SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("armfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("armleft"));
this.setTransparency(300);
box.setName("leftarm");
box.build();
}
}
Leftleg:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
//biological left
public class LeftLeg extends Object3D{
/**
*
*/
private static final long serialVersionUID = 4705719438846904180L;
public LeftLeg() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);
SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("legfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("legleft"));
this.setTransparency(300);
box.setName("leftleg");
box.build();
}
}
Outerhead:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
public class OuterHead extends Object3D{
private static final long serialVersionUID = 3950765561884516490L;
public OuterHead() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-1.1f, -1.1f, -1.1f);
SimpleVector upperRightFront = new SimpleVector(1.1f, -1.1f, -1.1f);
SimpleVector lowerLeftFront = new SimpleVector(-1.1f, 1.1f, -1.1f);
SimpleVector lowerRightFront = new SimpleVector(1.1f, 1.1f, -1.1f);
SimpleVector upperLeftBack = new SimpleVector(-1.1f, -1.1f, 1.1f);
SimpleVector upperRightBack = new SimpleVector(1.1f, -1.1f, 1.1f);
SimpleVector lowerLeftBack = new SimpleVector(-1.1f, 1.1f, 1.1f);
SimpleVector lowerRightBack = new SimpleVector(1.1f, 1.1f, 1.1f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("hatfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("hatfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("hatback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("hatback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("hattop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("hattop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("hatleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("hatleft"));
this.setTransparency(300);
box.setName("hat");
box.build();
}
}
Rightarm:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
//biological right
public class RightArm extends Object3D{
/**
*
*/
private static final long serialVersionUID = -5257845406283197478L;
public RightArm() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);
SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("armfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("armleft"));
this.setTransparency(300);
box.setName("rightarm");
box.build();
}
}
Rightleg:
package com.aeroshark333.skinviewer.skinparts;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;
//biological right
public class RightLeg extends Object3D {
/**
*
*/
private static final long serialVersionUID = 8223363127837467932L;
public RightLeg() {
super(12);
final Object3D box = this;
SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);
SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("legfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("legleft"));
this.setTransparency(300);
box.setName("rightleg");
box.build();
}
}