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.

http://www.wantonhubris.com/obj-2-map/

Have at it! I think everything will work.

[edit: updated url]
First | Previous | Next | Last
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! 
Hm 
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:
https://www.dropbox.com/home/quake?preview=walker.png 
Kreathor 
argh - sure, sending over the .obj would be great. 
Ericw 
I just wanted to export "shit" like this: http://78.47.23.219/head_obj.jpg

Maybe I was too optimistic :D 
Screenshot Derp 
here's the working link: https://www.dropbox.com/s/a9zgelk79nq9zol/walker.png?dl=1

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

that would be cool though! 
 
If you listen carefully you can hear the BSP format sobbing gently in the corner. 
Promising But Some Errors.. From 3dsmax 
So I gave it a spin and it does some things right and others wrong with my current setup as far as I can tell.

Here is a screenshot showing my lovely test cylinder in 3dsmax and the resulting data inside TB2.

https://dl.dropboxusercontent.com/u/1849053/OBJ_Mapped_Error.jpg

For starters when I load my wad file it applies all the textures correct. But for some reason in 3dsmax its taking the name of the texture from the material name? And not the actual texture loaded. Oh well I can make that work.

It does get the tiling amount correct for the top but the side faces are skewed. I do believe TB2 supports Valve220 though unless I missed something. I've also included the OBJ output from 3dsmax and the wad file I used.

https://dl.dropboxusercontent.com/u/1849053/cylinder_test.zip 
Hmm Weird 
I think you set everything up correctly, but when I convert your obj it looks fine.
Old build of TB2 by any chance? Double check in Jackhammer? 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.