Click here to Skip to main content
15,884,298 members
Articles / Multimedia / DirectX

Loading and Rendering Milkshape 3D Models with Animation and Skinning

Rate me:
Please Sign up or sign in to vote.
4.81/5 (13 votes)
18 May 2011CPOL5 min read 88.4K   4.6K   31  
This article shows how to load Milkshape ms3d binary files, animate and display them with OpenGL
package TestJApplet;
import com.jogamp.opengl.util.FPSAnimator;
import javax.media.opengl.GLAutoDrawable;

public abstract class GLSkeleton<D extends GLAutoDrawable>
{
  public final D drawable;
  protected FPSAnimator animator;
  protected int FramePerSecond = 24;

  public GLSkeleton()
  {
    this.drawable = createDrawable();
  }

  protected abstract D createDrawable();

  public final void refresh()
  {
    if (this.drawable == null)
      throw new RuntimeException("GLDrawable is not set.");
    this.drawable.display();
  }

  public final void setAnimator(FPSAnimator paramFPSAnimator)
  {
    this.animator = paramFPSAnimator;
  }

  public final void runExit() {
    new Thread(new Runnable() {
      public void run() {
        if (GLSkeleton.this.animator != null)
          GLSkeleton.this.animator.stop();
        GLSkeleton.this.drawable.destroy();
      }
    }).start();
  }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Research Institute For Artificial Intelligence, Ro
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions