diff options
-rw-r--r-- | ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleMd3Example.java | 63 | ||||
-rw-r--r-- | ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.jpg | bin | 0 -> 51113 bytes | |||
-rw-r--r-- | ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.md3 | bin | 0 -> 65252 bytes | |||
-rw-r--r-- | ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.qc | 19 |
4 files changed, 82 insertions, 0 deletions
diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleMd3Example.java b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleMd3Example.java new file mode 100644 index 0000000..f3739d4 --- /dev/null +++ b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleMd3Example.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.example.pipeline; + +import com.ardor3d.example.ExampleBase; +import com.ardor3d.example.Purpose; +import com.ardor3d.extension.model.md3.Md3DataStore; +import com.ardor3d.extension.model.md3.Md3Importer; +import com.ardor3d.math.MathUtils; +import com.ardor3d.math.Quaternion; +import com.ardor3d.math.Vector3; +import com.ardor3d.scenegraph.Node; + +/** + * Simplest example of loading a model in MD3 format. FIXME update the description and the thumbnail + */ +@Purpose(htmlDescriptionKey = "com.ardor3d.example.pipeline.SimpleMd2Example", // +thumbnailPath = "com/ardor3d/example/media/thumbnails/pipeline_SimpleMd2Example.jpg", // +maxHeapMemory = 64) +public class SimpleMd3Example extends ExampleBase { + public static void main(final String[] args) { + ExampleBase.start(SimpleMd3Example.class); + } + + @Override + protected void initExample() { + _canvas.setTitle("Ardor3D - Simple Md3 Example"); + _canvas.getCanvasRenderer().getCamera().setLocation(new Vector3(0, 5, 20)); + + // Load the scene + final long time = System.currentTimeMillis(); + final Md3Importer importer = new Md3Importer(); + // try { + // importer.setTextureLocator(new MultiFormatResourceLocator(ResourceLocatorTool.getClassPathResource( + // SimpleObjExample.class, "com/ardor3d/example/media/models/md2/"), ".dds", ".jpg", ".png", ".tga", + // ".pcx")); + // } catch (final URISyntaxException ex) { + // ex.printStackTrace(); + // } + + final Md3DataStore storage = importer.load("md3/barrel1.md3"); + System.out.println("Importing Took " + (System.currentTimeMillis() - time) + " ms"); + + final Node model = storage.getScene(); + // md2 models are usually z-up - switch to y-up + model.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X)); + // attack to root + _root.attachChild(model); + + // speed us up a little + // final KeyframeController<Mesh> controller = storage.getController(); + // controller.setSpeed(8); + // controller.setRepeatType(RepeatType.WRAP); + } +} diff --git a/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.jpg b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.jpg Binary files differnew file mode 100644 index 0000000..9bda495 --- /dev/null +++ b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.jpg diff --git a/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.md3 b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.md3 Binary files differnew file mode 100644 index 0000000..1a8ce49 --- /dev/null +++ b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.md3 diff --git a/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.qc b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.qc new file mode 100644 index 0000000..54b95f6 --- /dev/null +++ b/ardor3d-examples/src/main/resources/com/ardor3d/example/media/models/md3/barrel1.qc @@ -0,0 +1,19 @@ +// Quake III Arena MD3 control file, generated by MilkShape 3D +// +$model "models/furniture/barrel1.md3" +// reference frame +//$frames -1 -1 +// frame 1-30 +$frames 1 30 +$flags 0 +$numskins 0 + +// you can have one or no parent tag + +// tags + +// meshes (surfaces) +$mesh "barrel" +$skin "models/furniture/barrel1.jpg" +$flags 0 + |