jPCT-AE - a 3d engine for Android > Bugs

setScale doesn't seem to work for serialized objects.

(1/3) > >>

zammbi:
I was converting one of my models from 3ds to a serialized object with jBush. Basically just a simple swap but setScale in my code doesn't seem to work(works fine for the 3ds model). I even scaled it in jBush also but that had no effect.

Is this some kind of bug or am I missing something?

EgonOlsen:
setScale() just modifies the rotation matrix. I don't see why this shouldn't work on serialized objects...it actually has nothing to do with the way the object has been created!? Can you create a test case for this?

zammbi:
Ok, I'll create one now.

zammbi:
Odd new problem when I leave out 'build' method it crashes. Its mostly your helloworld example, but just loading the stadium model.


--- Quote ---03-06 12:00:10.842: I/jPCT-AE(3523): [ 1330988410844 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!
03-06 12:00:10.842: I/jPCT-AE(3523): [ 1330988410846 ] - ERROR: java.lang.NullPointerException
03-06 12:00:10.842: I/jPCT-AE(3523):    at com.threed.jpct.Object3D.transformVertices(Object3D.java:6316)
03-06 12:00:10.842: I/jPCT-AE(3523):    at com.threed.jpct.World.renderScene(World.java:1105)
03-06 12:00:10.842: I/jPCT-AE(3523):    at com.threed.jpct.example.HelloWorld$MyRenderer.onDrawFrame(HelloWorld.java:251)
03-06 12:00:10.842: I/jPCT-AE(3523):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1127)
03-06 12:00:10.842: I/jPCT-AE(3523):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)
03-06 12:00:10.862: W/dalvikvm(3523): threadid=43: thread exiting with uncaught exception (group=0x2aaca408)
03-06 12:00:10.862: E/AndroidRuntime(3523): Uncaught handler: thread GLThread 22 exiting due to uncaught exception
03-06 12:00:10.862: E/AndroidRuntime(3523): java.lang.RuntimeException: [ 1330988410846 ] - ERROR: java.lang.NullPointerException
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.Object3D.transformVertices(Object3D.java:6316)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.World.renderScene(World.java:1105)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.example.HelloWorld$MyRenderer.onDrawFrame(HelloWorld.java:251)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1127)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.Logger.log(Logger.java:189)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.Logger.log(Logger.java:148)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.World.renderScene(World.java:1121)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at com.threed.jpct.example.HelloWorld$MyRenderer.onDrawFrame(HelloWorld.java:251)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1127)
03-06 12:00:10.862: E/AndroidRuntime(3523):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)
03-06 12:00:10.872: I/dalvikvm(3523): threadid=7: reacting to signal 3
03-06 12:00:10.882: I/dalvikvm(3523): Wrote stack trace to '/data/anr/traces.txt'

--- End quote ---

Eclipse project: http://www.mediafire.com/?8eaklsygi06jnp1

However it seems it scales fine in this example which is annoying... So trying to figure out what's the difference.

zammbi:
Ok found where the problem happens.

It's when I merge the object. It removes the scale, your right it has nothing to do with serialized objects.

--- Code: ---Object3D.mergeObjects(ground, model);
--- End code ---

How do I keep the scale when I merge? There is no scaleMesh method that I can see.

Navigation

[0] Message Index

[#] Next page

Go to full version