3Ds max options

Started by Thomas., December 22, 2010, 08:13:11 PM

Previous topic - Next topic

Thomas.

What all can I use in 3Ds max for correct displayed in render scene? (UVW mapping, opacity, specular, diffuse color or bitmap,...). Thanks :)

EgonOlsen

jPCT loads polygonal meshes, their texture information and -mapping as well as diffuse colors. It's not loading any camera, scene or lighting information.

Thomas.

And can I load from one 3ds more then one object?

EgonOlsen

Yes. jPCT will return you an array with the objects in the file.

Thomas.

Ok, but if I load 3ds file with complete scene (buildings, lamp, trees,...), how I find position of individual objects? And how can I use texture to specific object in scene? Some example would be very useful :)

Thomas.

#5
If I load objects from one 3ds file and every one add into world, everything have a bad position... How can I translate objects to position, where should be?
And my next issue is, that I can not load 3ds objects from SD...
If I use this, all are ok
int numbOfObjects = Loader.load3DS(res.openRawResource(R.raw.map01), 1).length;
but this not working
InputStream map = new FileInputStream(MAPS_PATH + "map01" + ".3ds");
int numbOfObjects1 = Loader.load3DS(map, 1).length;

and this working, but load only first object
levelObj[0] = Loader.load3DS(map, 1)[0];

and here is log
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

raft


Thomas.

Many thanks... problem with position is gone :)

Thomas.

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?

raft

try Object3D.getTransformedCenter()

getTranslation() does not help in this case, since your object isnt translated in world space. it's just an object with distant-to-origin polygons.


Thomas.

I used this and it not working  :(
levelObj[i] = Loader.load3DS(res.openRawResource(R.raw.map01), 1)[i];
InputStream part = new FileInputStream(PARTS_PATH + partName + ".3ds");
SimpleVector pos = new SimpleVector(levelObj[i].getTransformedCenter());
levelObj[i] = Loader.load3DS(part, 1)[0];
levelObj[i].translate(pos);

raft

first you should call build(). besides other things, build calculates center of object. also have a look at calcCenter method

Thomas.