[Bf-python] High level Mathutils additions

Gilbert, Joseph jgilbert at tigr.org
Tue Dec 21 19:42:23 CET 2004


You technical can't multiply a 3 dimensional vector by a 4x4 dimensional
matrix. You can pre- and post- multiply a 3 dimensional vector by a 3x4
and 4x3 dimensional matrix. The results of a [3] x [4][4] is undefined.
The issue of making copies because the data in the vector is not a
referenced pointer is something Stephan can address.

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell J
Barton
Sent: Monday, December 20, 2004 9:23 PM
To: Blender Foundation Python list; bf-committers at blender.org
Subject: [Bf-python] High level Mathutils additions

Hi, there are a number of math functions I find myself using a but, that

Id like to add into mathutils
Mathutils.TriArea(vec1, vec2, vec3)
- This would operate on 2d or 3d Vectors.

Mathutils.TriNormal(vec1, vec2, vec3)
- Return a unit length normal vector from 3 vectors - 3d only.

Mathutils.LineIntersect(vecA, vecB, vecX, vecY)
- works on a 2d or 3d vector, returns the intersection point or None if 
the line does not intersect.

Make it possible to multiple a 3d vector by a 4x4 matrix, at the moment 
you need to resize the vector to 4d and then do it-
this messes up Blenders internal state when you resize v.co to 4d- so 
you need to make a copy which is also annoying.

Any ojections?
- Cam



-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241

_______________________________________________
Bf-python mailing list
Bf-python at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list