Well, I found some animation code and tried to work it into my helloworld app that's being converted to my game. Right now, the mouse loads and I can move him right and left with the arrow keys. I added the animation code as shown(I'm including the game loop in case it's throwing something off). Basically, nothing at all happens. It works just like it did before I added the animation code. No errors are thrown. I tested the walk models as the stand and they all loaded. The stand model is still being displayed in the game.
Mouse = loadModel("stand.3ds",1);
Mouse.translate(0, 15, 0);
Mouse.build();
Mouse.createTriangleStrips();
TextureManager tm = TextureManager.getInstance();
Texture tex=new Texture("fur.jpg");
tm.addTexture("fur", tex);
tex = new Texture("red.jpg");
tm.addTexture("red", tex);
Mouse.setTexture("fur");
world.addObject(Mouse);
Animation walk = new Animation(4);
walk.addKeyFrame(loadModel("walk1.3ds",1).getMesh());
walk.addKeyFrame(loadModel("walk2.3ds",1).getMesh());
walk.addKeyFrame(loadModel("walk3.3ds",1).getMesh());
walk.addKeyFrame(loadModel("walk4.3ds",1).getMesh());
Mouse.setAnimationSequence(walk);
Mouse.animate(1);
Mouse.rotateY(3.1416f/2f);
camera=world.getCamera();
camera.setPosition(0,5,-75);
camera.lookAt(Mouse.getTransformedCenter());
Object3D platform = loadModel("platform.3ds",1);
platform.translate(0, 20, 0);
platform.build();
platform.setTexture("red");
world.addObject(platform);
}
private void loop() throws Exception {
fb = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
Canvas canvas=fb.enableGLCanvasRenderer();
fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);
frame.add(canvas);
while (frame.isShowing()) {
poll();
if(left){
if(goingRight){
if(rotL < 16){
Mouse.rotateY(3.1416f/16f); rotL++;}
if(rotL>15){
goingRight = false;rotL = 0;}
}
Mouse.translate(-.2f,0f,0f);
}
if(right){
if(!goingRight){
if(rotR < 16){
Mouse.rotateY(-3.1416f/16f); rotR++;}
if(rotR>15){
goingRight = true;rotR = 0;}
}
Mouse.translate(.2f,0f,0f);
}
camera.setPosition(Mouse.getTransformedCenter().x,5,-75);
lightVector.set(Mouse.getTransformedCenter().x,-10.0f,-20.0f);
light.setPosition(lightVector);
fb.clear(java.awt.Color.BLUE);
world.renderScene(fb);
world.draw(fb);
fb.update();
fb.displayGLOnly();
canvas.repaint();
Thread.sleep(10);
}