Tuesday, March 28th, 2006
Send comments and bug reports to kevin@duling.us
Milkshape 3D is a Shareware modeler. You can learn more about it at the Milkshape 3D Homepage.
Download MS3DLoader (v.1.0-build#8).
An example of using the MS3DLoader can be seen in this source file Viewer.java This program will load in a Milkshape 3D model and allow you to move the object about with the OrbitBehavior class. Note that the light source is indicated by a small white sphere. I've included the example Milkshape 3D model model.zip.
MS3DLoader uses the TextureLoader object in Java3D. By default, this only supports image formats of GIF and JPG. TextureLoader will automatically use JAI (Java Advanced Imaging) if it is installed. JAI provides support for many other formats such as BMP, PNG, and TIFF. You can learn more about JAI and download it free from Sun here.
This release finishes the work necessary for loading
animations. A behavior still needs to be written to interpolate
them. This version no longer requires the Little Endian
DataInputStream library.
Note: In the next release, I will be changing the package structure to reflect the domain duling.us
Setup:
import com.sun.j3d.loaders.*
import com.glyphein.j3d.loaders.milkshape.MS3DLoader;
Loader loader = new MS3DLoader(MS3DLoader.LOAD_ALL);
Loading a model from a URL:
com.sun.j3d.loaders.Scene scene = loader.load(url);
BranchGroup group = scene.getSceneGroup();
Loading a model from a file:
java.io.File file = new java.io.File("./model.ms3d");
if (file.getParent().length() > 0) // figure out the base path
loader.setBasePath(file.getParent() + java.io.File.separator);
Scene scene = loader.load(file.getName());
BranchGroup group = scene.getSceneGroup();
Screenshot:

I'm looking for a better Milkshape 3D model that can be used to demo my MS3DLoader for Java3D. I'm a programmer, not a modeler. The model should be free for use as it will have to be available for download. I'd like a model that has both animations and alphamaps. Textures can be in most formats, but I would prefer either GIF or JPG. The reason for this is that the Java runtime has built-in loaders for GIF and JPG, but an additional download of the JAI package is needed to support other formats such as BMP, TIFF and PNG. If you have a model that you'd like to show off, please let me know. I'll list whatever copyright info, contact info, links to your own page, or credit for your work that you'd like to have displayed.
I received a nice Alien model from Paul Hassett with Quake III animations. You can see more of his work at http://www.planetquake.com/polycount/downloads/index.asp?author=296.