Custom export/import of 3d models. Opinions please

Started by Del, February 11, 2009, 16:25:16

Previous topic - Next topic

Del

Hi,

I would like some opinions on the perfomance of a way I'm trying to load models. I wrote an exporter for 3ds max, its not a 100% yet but it works, it outputs a text file of the selected mesh. the text file is similar to .obj layout but it handles frames from 3ds max. so i end up with somthing like :

Frames 10
frameNumber 1
vert 231 1231 3132
textureVert 324 234 2342
faceNormal 123 1231 212
frameNumber 2
etc..

Its not to hard to modify so that it fits in with whatever way I try to read it in Java.

So, for pratice I'm using Kev's 3d asteroids tutorial source, it uses LWJGL and works really well for the way it loads a non animated model. I am in the process of modfying it so that it reads my text file, and for each frame it will create a new display list. I haven't studied much about how the display list works, but I'm pretty sure in this case it takes the converted data from the text file and uses OpenGL to set up the mesh/faces/textures(please correct me if I'm wrong). Then I hope to animate it just like I would in a 2d game. For example looping frames/lists 1-20 for a walk cycle.

I'm pretty sure i can get it to 'work' like this, but am I completley on the wrong track of how I should be animating 3d objects in games. Would you expect bad performance, I mean if it was coded reasonably well.

I'm not the best at explaining things somtimes, hope you can understand this.

Thanks, Derek

bobjob

thats basically how it works. Your on the right track.


Something else to consider is smoother animations for 3D animations.
When cycling through frames (at leasy with .obj) you can generate frames between frames, by finding the points between points.

I personally use 1-6 for a walk cycle (for low poly RTS humaniod models) and generate frames between them at load time.

Del

Great, I look into generating the frames in between after I see if i can get my exporter from max to work properly. All it is basically suppose to do is to stop from having tons of obj files, kinda trying to get alot into one text file.
I've heard of plugins/scripts that will output a series of obj files and number them for animation, I'll probably try that if I have no luck with what I'm attempting now.

Well, thanks for your time :)



bobjob

Quote from: Del on February 12, 2009, 10:04:18
All it is basically suppose to do is to stop from having tons of obj files, kinda trying to get alot into one text file.
Do you know much about using zip files? you could always place all your .obj's into a zip file resource.


Quote
I've heard of plugins/scripts that will output a series of obj files and number them for animation, I'll probably try that if I have no luck with what I'm attempting now.
Yeah thats what i do, using blender as it can export as animation (for .obj's).


Del

Quote from: bobjob on February 12, 2009, 18:12:39
Do you know much about using zip files?
I  haven't tried reading from zip files in java yet.

I can't get my script right for exporting all the frames into one file. I can get all the info in there and and nicely formatted for my import code to read, just cant get the vertex normals right. So I guess I'll have to go with the multiple .obj files. I'm sure theres a script for max the will export the animations, If not I'll find another way. I mean if I do go with around 6 or so frames in a walk cycle it's not too much work to just go to each frame and export it.