Main Menu
Menu

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.

Show posts Menu

Messages - jumong

#1
Support / Re: loadSerializedObject problem
September 16, 2010, 10:28:47 AM
but error still occur. Is there any idea?
Is there another method that load big serialized md2 file?
#2
Support / Re: loadSerializedObject problem
September 16, 2010, 09:12:35 AM
Like this?

Object3D obj = Loader.loadMD2(new ZipInputStream(con.getResources().openRawResource(R.raw.obj)), 1);

obj is Zip file.

Otherwise, Can you explain in detail.
help
#3
Support / loadSerializedObject problem
September 16, 2010, 04:21:31 AM
I try to load big md2 file
The file size is 665Kbyte.

So I did like follow
    -In desktop JPCT
        InputStream fis = new FileInputStream("obj.md2");
OutputStream fos = new FileOutputStream("obj.ser");
DeSerializer de = new DeSerializer();
Object3D myobj = Loader.loadMD2(fis, 1);
myobj.build();
de.serialize(myobj, fos, true);

     -In jpct-ae
        Object3D obj = Loader.loadSerializedObject(con.getResources().openRawResource(R.raw.obj));
but android attached error.

09-16 10:28:11.699: WARN/System.err(448):     java.io.IOException
09-16 10:28:11.699: WARN/System.err(448):     at android.content.res.AssetManager.readAsset(Native Method)
09-16 10:28:11.709: WARN/System.err(448):     at android.content.res.AssetManager.access$700(AssetManager.java:36)
09-16 10:28:11.718: WARN/System.err(448):     at android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:574)
09-16 10:28:11.718: WARN/System.err(448):     at com.threed.jpct.DeSerializer.read(DeSerializer.java:421)
09-16 10:28:11.729: WARN/System.err(448):     at com.threed.jpct.DeSerializer.readInt(DeSerializer.java:404)
09-16 10:28:11.729: WARN/System.err(448):     at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:29)
09-16 10:28:11.739: WARN/System.err(448):     at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
09-16 10:28:11.739: WARN/System.err(448):     at com.threed.jpct.example.MainActivity$MyRenderer.onSurfaceChanged(MainActivity.java:289)
09-16 10:28:11.749: WARN/System.err(448):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
09-16 10:28:11.749: WARN/System.err(448):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
09-16 10:29:55.998: ERROR/AndroidRuntime(448): FATAL EXCEPTION: GLThread 8
09-16 10:29:55.998: ERROR/AndroidRuntime(448): java.lang.RuntimeException: [ 1284604091761 ] - ERROR: Can't deserialize object: null
09-16 10:29:55.998: ERROR/AndroidRuntime(448):     at com.threed.jpct.Logger.log(Logger.java:159)
09-16 10:29:55.998: ERROR/AndroidRuntime(448):     at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:188)
09-16 10:29:55.998: ERROR/AndroidRuntime(448):     at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
09-16 10:29:55.998: ERROR/AndroidRuntime(448):  at com.threed.jpct.example.MainActivity$MyRenderer.onSurfaceChanged(MainActivity.java:289)
09-16 10:29:55.998: ERROR/AndroidRuntime(448):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
09-16 10:29:55.998: ERROR/AndroidRuntime(448):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)



What am I doing wrong?
help
#4
Support / Re: How to rotate 3D object?
September 08, 2010, 09:14:28 AM
My full code

      public void onSurfaceCreated(GL10 gl, EGLConfig config) {
         TextureManager.getInstance().flush();
         world = new World();
         res = getResources();

         TextureManager.getInstance().addTexture("bw2",
               new Texture(res.openRawResource(R.raw.bw2)));

         boxgfx = Loader.load3DS(res.openRawResource(R.raw.obj), 50)[0];
         boxgfx.setTexture("bw2");
         boxgfx.rotateX((float) Math.PI/2);

                        boxgfx.translate(new SimpleVector(0,0,0));

         world.getCamera().setPosition(150, -50, -5);
         cameraPosition = new Vector3f(150, -50, -5);

         cameraTargetPosition = new Vector3f(0, 0, 0);
         world.getCamera().lookAt(0,0,0);

         Light light = new Light(world);
         light.setPosition(new SimpleVector(-200, -50, 80));
}
#5
Support / Re: How to rotate 3D object?
September 08, 2010, 08:38:33 AM
I did, but nothing changed...
#6
Support / Re: How to rotate 3D object?
September 08, 2010, 08:06:37 AM
Yes, front color is white and back color is black...

Thank you for your replay, I always thanks for your help
#7
Support / Re: How to draw line in 3D
September 08, 2010, 06:03:02 AM
Thank you for you help !!!
#8
Support / How to rotate 3D object?
September 08, 2010, 04:30:05 AM
I wanna rotate my 3D object
I did follow
boxgfx = Loader.load3DS(res.openRawResource(R.raw.obj), 50)[0];
boxgfx.setTexture("bw2");
boxgfx.rotateX((float)Math.PI);
boxgfx.translate(vec3d);
boxgfx.build();

but object doesn't rotate
What am I doing wrong?
         
#9
Support / How to draw line in 3D
September 07, 2010, 03:30:43 PM
I wanna draw line in 3D
How can I do
help
#10
Then, how to get 3d position in JPCT?
#11
Support / How to get 3D position by clicking 2d position?
September 07, 2010, 05:50:03 AM
How to get 3D position by click 2d position?
I did follow
Vector3f rayTo = new Vector3f(renderer.getRayTo((int) event.getX(), (int) event.getY()));

CollisionWorld.ClosestRayResultCallback rayCallback = new CollisionWorld.ClosestRayResultCallback(cameraPosition, rayTo);
dynamicWorld.rayTest(cameraPosition, rayTo, rayCallback);
if (rayCallback.hasHit()) {
  Vector3f vec = rayCallback.hitPointWorld;
}

but position is incorrect, What am I doing wrong?
#12
Support / How to create static object
September 03, 2010, 08:41:37 PM
Hi
How to create static object in dynamicsWorld?
help me
#13
Support / Re: How to convert simplevector to Vector3f?
September 03, 2010, 04:06:16 PM
thank you very much!!!
#14
Support / Re: How to convert simplevector to Vector3f?
September 03, 2010, 12:33:38 PM
vector3f is used in DynamicsWorld
#15
Support / How to convert simplevector to Vector3f?
September 03, 2010, 11:58:56 AM
hi,
How to convert simplevector to Vector3f?
What different of simplevector and vector3f?
help