[Gtkradiant] shift/scale/rotate to BP translation

Shamus jlhamm at acm.org
Fri Mar 3 22:10:06 CST 2006


Hi all,

I've been trying to write a quick-n-dirty command line conversion tool 
to help in the regular brush mode to brush primitive mode using the 
FakeTexCoordsToTexMat() procedure found in brush_primit.cpp. The 
maddening thing is that it *almost* works, but not quite. For example, 
take the following brush:

// brush 156
{
//This is the face we're concerned with
( 637 193 126 ) ( 788 193 126 ) ( 788 193 62 ) 01narshadda/00abb3-4 116 
30 270 0.250000 -0.220000 0 0 0
//The rest just defines the scope of the brush
( 781 596 126 ) ( 781 610 126 ) ( 781 610 62 ) common/caulk 0 0 0 
0.250000 0.250000 0 4 0
( 670 609 126 ) ( 670 595 126 ) ( 670 595 62 ) common/caulk 0 0 0 
0.250000 0.250000 0 4 0
( 817 197 126 ) ( 666 197 126 ) ( 666 197 62 ) common/caulk 0 0 0 
0.250000 0.250000 0 4 0
( 778 610 92 ) ( 778 596 92 ) ( 627 596 92 ) common/caulk 0 0 0 0.250000 
0.250000 0 4 0
( 640 596 62 ) ( 791 596 62 ) ( 791 610 62 ) common/caulk 0 0 0 0.250000 
0.250000 0 4 0
}

The size of the texture for the face we're interested in is 128 x 512 
and fits the face for exactly one copy of the texture. Note the 
shift/scale/rotate for that face is (83, -304) / (0.25, -0.22) / 270. 
When you take this same exact brush and put it into a BP map, the values 
the surface inspector reports for a one copy exact fit is (147, -304) / 
(0.2168, -0.22656) / 270 which doesn't match at all; this implies that 
the transform done by FakeTexCoordsToTexMat() (and it's inverse) aren't 
accurately converting from one form to the other.

I guess my question is, then, how can I do the tranformation? Is it even 
possible?

-- Shamus



More information about the Gtkradiant mailing list