[Bf-python] Re: problem with absolute vertex coords

joeedh joeeagar at prodigy.net
Thu Feb 3 02:32:55 CET 2005


Melchior FRANZ wrote:

>* Melchior FRANZ -- Thursday 03 February 2005 01:08:
>  
>
>>I wrote a Python script[1] that outputs vertex coordinates to an xml file that I
>>can directly use for FlightGear[2] animations. But it turned out that the coords
>>aren't correct -- they are too big.
>>    
>>
>
>Forgot to mention that this is Blender 2.36, compiled under Linux 2.6.10 with
>gcc 3.3.4 against libc 2.3.3. Python 2.3.
>
>m.
>_____
>  
>
You have to multiply the vertex by the object's 4x4 3d transformation 
matrix.  I think this involves Mathutils.  You just copy the vertex 
location into a Mathutils.Vector object (it should already be in one, 
actually I think)  resize it to 4D (as wierd as that sounds, it adds a 
fourth element to the location array) then use |the MatMulVec mathutils 
function|| 
<http://www.blender.org/modules/documentation/236PythonDoc/Mathutils-module.html#MatMultVec>|.  
See 
http://www.blender.org/modules/documentation/236PythonDoc/Mathutils-module.html 
.
Oh, and theres no need to add the location if you're doing that, since 
you're using a 4x4 matrix.

joeedh



More information about the Bf-python mailing list