View Full Version : Milkshape model loading on a Mac?
Mars_999
2002.07.24, 06:38 AM
Ok, on PC their is a program called milkshape that has been used in quite a few FPS games I guess. I would like to use this program to make mechs, tanks type models and load the model on the Mac. Do to I am unsure where I could get a good tutorial on how to code a correct .obj or .3ds function for loading models. If I could code a () to load .obj files then I would not need milkshape and could use any Mac 3D rendering program. I don't know for sure if .mesh files hold the textures info or not? I thought .obj files or .3ds files have the textures data stored with it? Maybe I am completely off base and dreaming of something else? =)
GoodDoug
2002.07.24, 01:31 PM
Milkshape can export to MD2 and MD3 formats, for which there are many code examples to load those. There's even an MD2 loader in Apple's sample code archive (not a great one though, it is very parochial about which models it will accept).
Also, at chumbalum's website there is an sdk and a model parser: <http://www.swissquake.ch/chumbalum-soft/files/MsViewer.zip>
One of those options should work for you.
Mars_999
2002.07.24, 03:12 PM
Thanks I will check it out.
Namoreh
2002.07.24, 05:22 PM
NeHe has a tutorial on loading both MD2 and Milkshape models, I haven't read it, so I don't know how how much would have to be done differently to get it to run on Mac though.
The tutorial's at:
http://nehe.gamedev.net/trentp/gametutorials/lesson04.asp
Namoreh
Ian Kerr
2002.08.15, 11:52 PM
I don't know if you're still interested but I ported the NeHe code to the Mac a long time ago. Here is the code
http://www.mnsi.net/~rkerr/source/md2.h
http://www.mnsi.net/~rkerr/source/md2.cpp
http://www.mnsi.net/~rkerr/source/normal.h
http://www.mnsi.net/~rkerr/source/normal.cpp
It's pretty messy and you'll have to edit it a bit since it was modified for my old engine. You aren't going to want the MD2 class to inherit from Object so you'll have to take that stuff out. The Endian conversion methods are in a header file included with CodeWarrior. Search your HD for them if you can't find them. I also modified it to interpolate the animation so that it's smoother.
kberg
2003.12.10, 05:26 PM
if you want .obj file loading with support for textures, you could always use this as well:
http://www.sfu.ca/~kberg/Code/ObjLoader.tgz
kelvin
2003.12.10, 06:07 PM
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=31
There's a Cocoa port of this tutorial available for download at the bottom of the page.
MacFiend
2004.01.03, 08:23 AM
Just wanted to let you know that the NeHe port doesn't appear to compile properly with Xcode and 10.3.2.
kelvin
2004.01.04, 12:40 AM
Just wanted to let you know that the NeHe port doesn't appear to compile properly with Xcode and 10.3.2.
I got it to compile with minor tweaking.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.