Show Posts

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.


Messages - OneManSitting

Pages: [1]
1
Support / Re: Adding a 3DS model with a texture
« on: November 09, 2012, 08:54:26 pm »
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/

2
Support / Re: Adding a 3DS model with a texture
« on: November 08, 2012, 10:31:33 pm »
I guess there is something wrong with my file system now.... I get a little red x on my 3ds folder.

http://imgur.com/vJORL

3
Support / Re: Adding a 3DS model with a texture
« on: November 08, 2012, 10:04:15 pm »
Code: [Select]

 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);

Like this? Oh well i will keep plugging away  :o

still getting the same thing in logcat

4
Support / Re: Adding a 3DS model with a texture
« on: November 08, 2012, 09:23:34 pm »
Code: [Select]

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());
        }

11-08 15:18:30.797: E/AndroidRuntime(481): java.lang.RuntimeException: [ 1352405910765 ] - ERROR: Couldn't read file from InputStream

I tried to use a string but it wont let me, but i get an error that says only a string is allowed.

Do i need to create a jar file like in this post?
http://www.jpct.net/forum2/index.php/topic,475.0.html

5
Support / Re: Adding a 3DS model with a texture
« on: November 08, 2012, 07:16:25 pm »
Ok i updated and changed the libs folder but now i get this error.

11-08 13:09:01.397: E/AndroidRuntime(370): java.lang.RuntimeException: [ 1352398141349 ] - ERROR: Not a valid 3DS file!
11-08 13:09:01.397: E/AndroidRuntime(370):    at com.threed.jpct.Logger.log(Logger.java:189)
11-08 13:09:01.397: E/AndroidRuntime(370):    at com.threed.jpct.Loader.load3DS(Loader.java:1462)

Anyone run into this before?


6
Support / Adding a 3DS model with a texture
« on: October 27, 2012, 11:52:55 pm »
 :P

I have the texture in jpctLoadModel02/res/drawable-hdpi called leaf1.jpg and the leaf1.3ds file in jpctLoadModel02 default folder.

Code: [Select]
String[] leafTexture = {"leaf1"};
String leafModelName = "leaf1.3ds";
InputStream isLeaf;
Object3D[] leafModel;

Then in the onSurfaceChanged method
Code: [Select]
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());
        }

 In the logcat it shows as:
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)

Am i suppose to use another kind of Loader method or am i just looping through them incorrectly. I thought i would only get one Object3d file and then add that into the world, but it always crashes on me.

7
Support / Re: Screen orientation and camera
« on: September 26, 2012, 05:16:41 pm »
well i mean you can calculate the field of view. :-\

8
Support / Re: jPCT-AE wiki
« on: September 23, 2012, 11:48:59 pm »
yes i got it, thank you.  ;D

9
Support / Re: jPCT-AE wiki
« on: September 14, 2012, 07:47:26 pm »
Thanks for making such a great wiki, and i would love to take part in it.

Pages: [1]