Page 1 of 2

How to make a .cfg file for .obj?

Posted: December 17th, 2009, 1:47 am
by Eagle
I have read Radder’s tutorial on importing an .obj file into Sandbox and it works flawlessly. But I am not very familiar with using .cfg files and need some help from you programmers out there. The problem I have is when I try to use multiple textures and animation. If I had a sample .obj file I would be good to go. I can get the model into Sandbox with one texture as a static object bat that’s as far as I have been able to get.
Screenshot;
Image

And this is the link to the Dwarf model if you want to take a crack at it; I have included the animation ranges as well. You are free to use this model as you wish with no restrictions. This model was created by a friend of mine named Psionic. He has a bunch of great free models on his site, so if you go there tell him Eagle sent you.
http://www.psionic3d.co.uk/

Here is the .rar file download of the Dwarf.
http://www.eaglesoftworks.com/Sandbox/Dwarf.rar

All I ask if you share what you learn with me about this .cfg file. I need to use multiple textures and be able to run animations using the .obj format.

Thanks for your help!

Always~
Vickie ;)

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 2:28 am
by GR1M
What I have read you can't use animations with the obj format with sandbox I’m not 100% positive on this but I’m pretty sure you cant. And loading multiple textures on to a obj I’ve never seen it done myself but I’m sure you can accomplished this with the cfg its very similar to all the rest of cfgs out there for md2, md3 and md5 just basically replacing the format name...take a look at some of the model cfgs. Are you can try combining all the textures into one texture file and renaming it "skin" I’m not really a modeler and don’t have very much experience in that area but I think its possible.

This might be a help --> http://sauerbraten.org/README.html

Gr1m :twisted:

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 2:51 am
by Eagle
Hi Gr1m, thanks for the reply :)
Well if that is the case then I will have to use another format, probably the .md3. I wish we could use the .X format for this engine; it would solve so many of these issues with importing models. There are also the licensing problems to consider. I mean can we use the .md3, .md2 and .md5 formats legally? It’s a lot to think about. These formats were created by 'Id software and Ion Storm, And are proprietary to their development teams I believe.

Always~
Vickie ;)

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 8:28 am
by Mike
All of our models are in the packages/models folder. It might help to check out some of the .cfgs for the models to get a good idea. md5 is really what should be used for characters, though md3 has decent animations too. The robochimp for example is md5 and the ogre is md3. Having more model format support would be awesome, but we also need a coder who knows how to do that kind of thing. It is open source so maybe you know a friend or two might be able to help with that? As far as the license, I'll look into it further, but Sandbox is based off of the Cube 2 engine and they are generally really good about making sure license stuff is set. Also the source for the id engines is open and I'm sure it would include model code in there. In addition many other projects use those formats. Not a bad idea just to make sure though and get something written. Grim, why didn't you just link: http://sauerbraten.org/docs/models.html hehe. Take care.
-mike
EDIT okay I got my answer:
http://www.modwiki.net/wiki/MD5_%28file_format%29 (From the official doom 3 wiki)
Open Format Explained - http://en.wikipedia.org/wiki/Open_format

Seems everything is good to go, good to know though, thanks for the great question!
-mike
PS isn't the .X format softimage? Looks like there is an md5 exporter on that webpage :D

MORE EDITS WOOOO
Okay so .X wasn't softimage, but I found some interesting info:
http://www.toymaker.info/Games/html/3d_models.html
So you could put .X into blender for example and then export from there into md3 or md5. Since I imagine you mainly use truespace (do you use any other modeling software?) here is a nice link for you:
http://forums1.caligari.com/truespace/s ... php?t=8322

Take care!
-mike

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 12:57 pm
by Eagle
Wow you seriously did your research Mike! Thanks for all the great information. The other modelers I use are 3Dmax 9, Milkshape, Gamespace and 3DWS. I’m so happy the mdl formats are open to us, that will make things a lot less complicated. I do have a friend that is a hard core programmer and I’m going to talk to him about adding some features to this engine to help us all.

Thanks again Mike!
Always~
Vickie ;)

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 1:17 pm
by Mike
The biggest thing we could use is help with Coop such as syncing model animations and the like over the server. It would be awesome if the RPG could be MP. There is Coop editing code and there are MP game modes and code for player models (and weapons if we add them for water wars) to be synced. Apparently triggers are working in MP now though I haven't tested it. There are also MP bots which I guess could be replaced with monster models to be MP monster or creatures. The big things would be to make sure dialog and models animate properly online. Depending on your coders interests perhaps it would be nice to make a list of what we need help on. For more than just him too I think, it would be nice to get a community wish list. Take care and I can't wait to see your Sandbox creations, I hope you eventually post some stuff on here :D We also have a screenshot gallery too that you can always upload screens to. Take care!
-mike

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 1:21 pm
by daniel_san
.X is the DirectX format as far as I understand. Cube 2 is written in opengl so I doubt rendering a .X mesh is going to happen anytime soon.
Blender does have the ability to Import .X so that might be of some help. I don't know how much experience you have with blender but
it's a great 3d app once you get by the user interface. Call me crazy but I've actually come to prefer blender over 3ds max and maya.
I guess its more a matter of not having to worry about licensing with blender.

A little explaination on md3s/md5s. Md3s are vertex animations, all of the animation is stored in one .md3 file.
Md5s actually use the bones/rig/armature (whatever you want to call it) for animation.
You need a seperate md5anim file, along with your md5mesh, for each animation you would like to use.

I downloaded the dwarf.rar you posted and after I imported the included .obj into blender I found there to be no animation. Other than that, sweet model.
If you could somehow get your friend to export to a format that supports animation I would have no problem converting it to an animated md3 for you.
Edit Actually it seems that animations aren't supported for importing an obj in blender. Still wouldn't mind seeing what the character looks like animated.
The reason the texture for the axe doesn't look right is the axe and dwarf were one mesh.
To texture them properly you need to seperate the axe from the rest of the model, and rename the object.
Down below I have posted a link to an archive where I have converted this model to md3. If you look at the config file youll see how I textured the dwarf and axe seperate.

http://www.mediafire.com/?t4yjkmyzn42

hope this was of some help
take care.

-daniel_san

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 4:41 pm
by Eagle
Thanks for the information Daniel_san, Let me get that in a format you can work with. Would a Milkshape file be ok or would you like something more traditional like .3Ds or .X ?
Always~
Vickie ;)

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 5:00 pm
by daniel_san
blender can import .ms3d .3ds and .X so pretty much any one of those would be good. However Im really not sure which ones support animation importing in the scripts themselves, so the more formats the better.

Re: How to make a .cfg file for .obj?

Posted: December 17th, 2009, 5:51 pm
by Eagle
Here you go Daniel_san, I have included the .X, .3ds, .obj and .ms3d formats.
If you get it to work with multiple textures share with me what you learn ok~
Download here:
http://eaglesoftworks.com/Sandbox/Dwarf.rar

Always~
Vickie ;)