News | Forum | People | FAQ | Links | Search | Register | Log in
Transformation Matrix Between Two Triangles
Hi friends !

I am taking a stab at mapping, but not before I write an exporter for blender. As one does.

The geometry is sorted:
look at suzanne here

But man, the texturing. I figured out that only the valve map format is capable of reliably representing the texture mapping described in UV space and for this I need to construct a transformation matrix between the triangle in UV space ( or just think of it on the XY plane) and the triangle in 3d space. In particular I am struggling to get the rotation matrix and the shear matrix.

Does anyone here have some pointers ?

Thanks !

PS, although I am convinced Blender is capable of acting as a full-fledged Map editor with import and export, I want this add-on to act in tandem with trenchbroom. Simply put, every object you export as faces will be a func_detail entity that one can append to an existing map (you'll need to reload it in tb).
I've made an exporter for Blender just recently, with UV code ported from OBJ2MAP.
You can export to clipboard and paste directly into Trenchbroom. 
Thanks ! 
This is so cool, exactly what I was brewing, but finished !

Takes a load of my mind, thanks. I forked the repo, if I have tweaks, I'll issue a pr. I'll prob try to get copy to clipboard working on linux and triangulating the mesh by default, or as an option, oh and a scaling option. =)

Great work, thanks ! 
Yay Textures. 
Just as an aside, I noticed we can now describe brushes with some manner of floats (three decimals, I think) instead of pure ints.

But I remember mappers making a big deal of things being on grid, why is that exactly ? 
I think the grid doesn't matter much as far as the final .bsp is concerned, it's mostly relevant to the editor and the compiler, and both have progressed a fair bit over the years. I'm not the authority on the subject though.

One side-effect of dealing with floats and precision is that sometimes a face that looks planar in editor isn't actually planar (for the compiler). You'll know when it happens though (warnings like "point is off plane.."). Triangulation avoids the off-plane errors, but can still lead to problems with very thin visleafs. Staying on grid is just safer.

Triangulation has an important downside in that the result is going to be very inflexible in Trenchbroom (can't really extrude or anything).

I assumed the clipboard would work across systems, though I haven't tested the exporter on other editors or systems at all. 
Very Cool 
Netradiant needs a space between UVs [ 1 0 0 0 ][ -0 -0 -1 0 ] otherwise "error at '][': expected ']'" and map fails to load.
Awesome stuff tho! 
Fixed the missing space, thanks 
You must be logged in to post in this thread.
Website copyright © 2002-2023 John Fitzgibbons. All posts are copyright their respective authors.