LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: NickyP101 on March 01, 2006, 07:37:26

Title: 3D Models
Post by: NickyP101 on March 01, 2006, 07:37:26
Hey all,

Im using Java with OpenGL (using lwjgl) to create a 3D shooter.

Its come to the time where i need to implement some 3D models into my game, ive found some good ones on the internet in .3ds format. i have no idea how i can implement these models into my game??

Im really not sure what steps i need to take.

Any help would be greatly appreciated.

Thanks in advance, Nick
Title: hmmmmm...
Post by: Fool Running on March 01, 2006, 18:18:08
Unfortunatly, the best way to do it is to write a model loader yourself. This will allow you to load the model in a way that your engine understands best. If you search Google you can find the file format for .3ds files.

Otherwise you can try to find a loader and adapt it into your engine.

In my opinion model loading is one of the most annoying things that a programmer has to deal with when making a game engine. :lol:
Title: 3D Models
Post by: elias4444 on March 01, 2006, 19:10:06
I'd also check out the source code (or just use the engine itself) for jMonkeyEngine or Xith3D. I spent a whole lot of time writing model loaders, and only afterwards learned that others had already done it. Go figure. :P
Title: 3D Models
Post by: napier on March 01, 2006, 19:44:34
This class reads verts and triangles from a 3DS file:
   http://potatoland.com/glart/week6/glmodel/GL_3DS_Reader.java

   see: load3DSFromStream()

This does a pretty basic load of vertices, triangles and texture mapping.  For the moment it assumes there is one object in the file, but could be easily extended to load multiple objects.  This class just loads data into ArrayLists, so you can take it from there.
Title: 3D Models
Post by: NickyP101 on March 02, 2006, 06:32:41
Thanks guys, ill get started :)
Title: 3D Models
Post by: crash0veride007 on June 10, 2006, 03:24:55
See my post here:
http://www.javagaming.org/forums/index.php?topic=14021.0

My stuff is in JOGL but should be easily ported to LWJGL.