I found this example that makes the 3ds file into a xml file. Still cant get it to work properly though.
http://www.bayninestudios.com/2011/01/importing-3d-models-in-android/
http://www.bayninestudios.com/2011/01/importing-3d-models-in-android/
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
try {
InputStream isLeaf = new FileInputStream("C:/Users/Ian/workspace/jpctLoadModel02/3ds/lilacleaf1.3ds");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
leafModel = Loader.load3DS(isLeaf,1);
TextureManager.getInstance().addTexture(leafTexture);
InputStream is = new ByteArrayInputStream(leafModelName.getBytes());
System.out.println("loaded");
leafModel = Loader.load3DS(isLeaf,1);
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
SimpleVector sv = new SimpleVector();
for (int i = 0; i < leafModel.length; ++i) {
leafModel[i].build();
world.addObject(leafModel[i]);
cam.lookAt(leafModel[i].getTransformedCenter());
sv.set(leafModel[i].getTransformedCenter());
}
String[] leafTexture = {"leaf1"};
String leafModelName = "leaf1.3ds";
InputStream isLeaf;
Object3D[] leafModel;
Texture leafTex = new Texture(600,600);
for (int i = 0; i < leafTexture.length; ++i) {
TextureManager.getInstance().addTexture("res/"+leafTexture[i] + ".jpg");
}
//Modelname string to inputstream
try {isLeaf = new ByteArrayInputStream(leafModelName.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace(); }
leafModel = Loader.load3DS(isLeaf,1);
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
SimpleVector sv = new SimpleVector();
for (int i = 0; i < leafModel.length; ++i) {
leafModel[i].build();
world.addObject(leafModel[i]);
cam.lookAt(leafModel[i].getTransformedCenter());
sv.set(leafModel[i].getTransformedCenter());
}
10-27 21:33:22.549: E/AndroidRuntime(401): FATAL EXCEPTION: main |
10-27 21:33:22.549: E/AndroidRuntime(401): java.lang.NoClassDefFoundError: com.threed.jpct.RGBColor |
10-27 21:33:22.549: E/AndroidRuntime(401): at ian.capstone.JpctLoadModel02Activity.<init>(JpctLoadModel02Activity.java:54) |
10-27 21:33:22.549: E/AndroidRuntime(401): at java.lang.Class.newInstanceImpl(Native Method) |
10-27 21:33:22.549: E/AndroidRuntime(401): at java.lang.Class.newInstance(Class.java:1409) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.ActivityThread.access$1500(ActivityThread.java:117) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.os.Handler.dispatchMessage(Handler.java:99) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.os.Looper.loop(Looper.java:123) |
10-27 21:33:22.549: E/AndroidRuntime(401): at android.app.ActivityThread.main(ActivityThread.java:3647) |
10-27 21:33:22.549: E/AndroidRuntime(401): at java.lang.reflect.Method.invokeNative(Native Method) |
10-27 21:33:22.549: E/AndroidRuntime(401): at java.lang.reflect.Method.invoke(Method.java:507) |
10-27 21:33:22.549: E/AndroidRuntime(401): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) |
10-27 21:33:22.549: E/AndroidRuntime(401): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) |
10-27 21:33:22.549: E/AndroidRuntime(401): at dalvik.system.NativeStart.main(Native Method) |
Page created in 0.036 seconds with 13 queries.