Loading 3D Models in OpenGL

BlitzMax Forums/OpenGL Module/Loading 3D Models in OpenGL

Clyde(Posted 2005) [#1]
Hi I was wondering, if there's an openGL command to load in a 3D Model?

Or if theres any way to load in ASCII data, from either Milkshapes own format, or 3DS. Or in fact from a mesh file, be it 3DS, .X, .LWO etc. As I've had loads of problems with exporting many B3D meshes from milkshape as they export out all oddly, and the textures dont load at all. (From the samples with BMAX and the excellent Exron / Nehe tutorial lessons)

Many thanks,
THUMBZ


tonyg(Posted 2005) [#2]
Nehe Tutorial 31 is Model loading with Milkshape model.


Clyde(Posted 2005) [#3]
Thing with MS3D is though. that I'd need to rehack the material name reader so that it can find the textures if they're not in the same folder stated with saving in Milkshape. Shouldnt be too much of a chore.

Also worth noting, when using Exrons excellent MS3D loader - it doesnt like textures that are not in 128,256,512 sizes. Took me a while to phathom why the textures weren't showing.


Tom(Posted 2005) [#4]
Terrabits 3D level demo (in the showcase I think) has a basic B3D loader, though the code's a bit tricky to follow :)

I'm gonna have to bite the bullit and make one myself, I've been putting it off too long.


Clyde(Posted 2005) [#5]
Would it be too difficult to load MD2 models, and 3ds models?
That would be great to be able to do.


AdrianT(Posted 2005) [#6]
were still having trouble with trinity's B3d loader, antony scaled the mesh -1 in one direction (not sure which) but as far as I can tell the actual local pivot doesn't get flipped. So any transforms end up being messed up and rotations done in max end up being in the wrong direction etc.

Hoping he get's it fixed tonight, If he doesn't maybe someone here who knows more about left hamded and right handed coordinate systems can help him out. It's a bit confusing at the moment heh lol.


AntonyWells(Posted 2005) [#7]
(Mental Note:NDAs are a good thing.)


{cYan|de}(Posted 2005) [#8]
lol


AdrianT(Posted 2005) [#9]
heh, what NDA. If anyone's been there before we might save ourselves a lot of trouble finding what were doing wrong :)

So long as we can make sense of whats is wrong.


eizdealer(Posted 2005) [#10]
Here, my loader. It's basically like Terrabit's loader but rewritten. In my opinion it's a little more obvious, if you can figure out what you'd have to change to make it work (I'm using my own Vertex, Triangle and Mesh types). But I think that should be easier than writing it on your own. If you have questions don't hesitate to ask or look at http://www.blitzbasic.com/sdkspecs/sdkspecs/userlibs_specs.txt .

Todo-List:
- Multiply all vertices with the local Node matrix (or the other way, you'll have to try)
- Brushes
- Bones / Animations



By the way a nice site for file formats is http://www.wotsit.org/search.asp?s=3d


AntonyWells(Posted 2005) [#11]
Evak, yeah but no but yeah but no...(It's a little british thing. :) )


AdrianT(Posted 2005) [#12]
heh, anyway your almost there Ant, the last version you sent just needs to get the local pivot rotation orientation right and your done. If I account for that in max it's perfect :)

thanks eizdealer, I'm sure we will get the animation done soon too since were that close it isn't funny.


patmaba(Posted 2005) [#13]
where can i found the class eeMesh, eeVertex.

The code don't compile :(