News | Forum | People | FAQ | Links | Search | Register | Log in
OBJ-2-MAP V1.1
So I added a few new features to my OBJ-2-MAP utility and put together a small web page explaining how to use it.

This is a utility that can take OBJ files exported from any modeling app and convert the geometry inside into Quake brushes.

Have at it! I think everything will work.

[edit: updated url]
First | Previous | Next | Last

There's a repository that Kreathor set up over here ...

The source has actually been updated and had a few features added ... so you contributing to that source tree would be ideal. 
Requires Login 
Ah, Cool! 
Looks like it's a private repo, I just asked kreathor to add me.

I'm going to try doing import of UV's and texture names from the obj file. If the model is triangluated and you export to Valve220 it should work flawlessly. 
Mother of god... 
Repo Is Public Now 
I made repo public! Sorry for inconvenience! :) 
ah mah gahd, this is awesome you guys! 
There's a fewest-planes wrapping algorithm floating around somewhere that would be ideal for exporting weird shapes like dragon heads in an optimum minimum number of convex brushes ... 
Oh My Goodness! 
Just out of curiosity is it possible to use valve220 map formats to make quake1 and 2 maps for the compilers? 
Yes, modern Quake compilers can process Valve220. 
This has probably been asked a dillion times, but does the .bsp format support arbitrary texture alignment or is it as limited as .map and you need .bsp2? 
Final .BSP Dont Care 
.bsp ultimately does not give a crap since its turned into pure polygons with uv coordinates. .map brushes and the way the data is stored was purely out of speeding things up during those dark days when unwrapping and texture alignment was a pain in the butt.

In fact you could in theory edit the texture mapping after a compile and replace it. 
its only quake3 that has actual xyz+st+lmst+rgb coords. the earlier versions all calculate everything based upon the xyz and their texinfo's texture planes (basically like valve220 with the scale+rotation things baked in to the plane itself).

this means the (software) renderer can generate the s+t coords dynamically after clipping, instead of having to clip those s+t coords to the screen too and getting extra imprecision+inefficiencies from doing so. 
Wait, really? So ... potentially I could, say, model an entire level and then use whatever eric is cooking up to turn it into an actual map? With custom UVs everywhere?

Don't tell me that's true ..I'll never sleep again... 
bsp.exe will be having a right old party, but it sounds like it :} 
UV Conversion 
This was a lot more of a pain than I thought, lol, but I think I got it working, Here is a beta.

If anyone tries it out:

Before doing the conversion, you have to add all of the textures used by the OBJ file to a Quake WAD, and put it in the same directory as the OBJ. (The reason for this is OBJ2MAP needs to get the Quake texture sizes is order to write the correct texture axis values.)

Secondly, the texture names are read from the "usemtl" lines in the .OBJ. Whatever's after "usemtl" is used as a texture name - directories and file extensions are stripped off first. I'm pretty sure this isn't quite the correct way to read skins from a .obj, I think you're supposed to use a material file, etc..

Finally the output is Valve 220 format only, so this is only usable with Hammer/Jackhammer/TB2/etc.

Future ideas:
- read .mtl file for looking up texture name?
- automatically read in the images referenced by the OBJ and convert them to a WAD file?

I included a sample model (from xonotic) that I was testing with, along with a texture wad, so you can see how things need to be set up for it to work.

source code is here 
NICE Time To Take This For A Spin. 
This should make for some crazy maps in the future if this works as I imagine it too... 
Crazy! Can someone post some screenshots of it working? :P How much freedom is actually possible here?

Or, a better question ... what sorts of limitations on UV mapping are there? 
More Complex OBJ Doesn't Work For Me 
I'm getting "Error computing texture vectors" in log.
Ericw I can send you an OBJ if you want. It's quite big. Everything exports except UVs.
Exporting simple box works lol :D

I was looking at code but have no clue why it's not working atm. Need more time to analyse your work :)

Ohhh... and in Jackhammer Y Scale of tex is 0, so you need to change it to 1 manually... 
Only limitation I'm aware of is, if the .OBJ contains quads, the tool will just pick 3 verts to compute the MAP texture alignment, and ignore the fourth.

Other than that, it seems to work as expected, it'll shear/rotate/scale/offset the texture as needed so the UVs line up.

I just have this ugly robot model (same one that's included in the obj2map zip) for a screenshot: 
argh - sure, sending over the .obj would be great. 
I just wanted to export "shit" like this:

Maybe I was too optimistic :D 
Screenshot Derp 
here's the working link:

khreathor: dunno, should be possible :P
Thanks, just got your email. 
That's pretty insane!! 
i think you are too optimistic :P

that would be cool though! 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2022 John Fitzgibbons. All posts are copyright their respective authors.