I loaded object from 3ds file and now I need translate other object to same position in worldspace, but method getTranslation and getWorldTranslation every return 0 as position, even method align does not working... any advice?
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 Menuint numbOfObjects = Loader.load3DS(res.openRawResource(R.raw.map01), 1).length;
InputStream map = new FileInputStream(MAPS_PATH + "map01" + ".3ds");
int numbOfObjects1 = Loader.load3DS(map, 1).length;
levelObj[0] = Loader.load3DS(map, 1)[0];
12-26 15:52:56.259: INFO/jPCT-AE(1955): Processing object from 3DS-file: =monitor01
12-26 15:52:56.263: INFO/jPCT-AE(1955): Object '=monitor01_jPCT9' created using 12 polygons and 8 vertices.
12-26 15:52:56.263: INFO/jPCT-AE(1955): Loading file from InputStream
12-26 15:52:56.263: INFO/jPCT-AE(1955): [ 1293375176265 ] - ERROR: Couldn't read file from InputStream
12-26 15:52:56.310: WARN/dalvikvm(1955): threadid=8: thread exiting with uncaught exception (group=0x4001d7d0)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): FATAL EXCEPTION: GLThread 9
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): java.lang.RuntimeException: [ 1293375176265 ] - ERROR: Couldn't read file from InputStream
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at com.threed.jpct.Logger.log(Logger.java:159)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at com.threed.jpct.Loader.loadBinaryFile(Loader.java:1083)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at com.threed.jpct.Loader.loadBinaryFile(Loader.java:1024)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at com.threed.jpct.Loader.load3DS(Loader.java:1409)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at com.threed.jpct.Loader.load3DS(Loader.java:143)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at cz.game.main.Demo$MyRenderer.onSurfaceChanged(Demo.java:701)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1325)
12-26 15:52:56.310: ERROR/AndroidRuntime(1955): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
12-26 15:52:56.310: WARN/ActivityManager(3166): Force finishing activity com.main/cz.game.main.Demo
Quote from: EgonOlsen on December 17, 2010, 09:09:56 PMFor example, if I want to set position of object3D same as light, I must do this everytime:
No. getPosition() is what getTranslation() or getTransformedCenter() do, setPosition() would be either translate(...) or clearTranslation();translate(...). No need to add additional methods that do the same thing.
SimpleVector lv = new SimpleVector(sun.getPosition());
sun.rotate(new SimpleVector(0, 0.05f, 0), plane.getTransformedCenter());
SimpleVector nlv = new SimpleVector(sun.getPosition());
light.translate(nlv.calcSub(lv));
Page created in 0.021 seconds with 10 queries.