Mathutils Module -- Blender Game Engine 2.49b


Class index  __

Method index  __

Mathutils index  __

Euler index  __

Matrix index  __

Quaternion index  __

Vector index  __


 




TriangleArea

TriangleArea(vec1, vec2, vec3)

Returns the area size of a 2D or 3D triangle.

Return Type:  float

vec1
Type:  2D or 3D Vector  (1st corner of the triangle)
vec2
Type:  2D or 3D Vector  (2nd corner of the triangle)
vec3
Type:  2D or 3D Vector  (3rd corner of the triangle)

Sample Code

# import Mathutils
import Mathutils

# create 1st vector for 1st corner
vec1 = Mathutils.Vector( 0.0, 0.0, 0.0)

# create 2nd vector for 2nd corner
vec2 = Mathutils.Vector (1.0, 0.0, 0.0)

# create 3rd vector for 3rd corner
vec3 = Mathutils.Vector( 0.0, 0.0, 1.0)

# get triangle area
triArea = Mathutils.TriangleArea(vec1, vec2, vec3)

 
The Blender Game engine uses the Python programming language to extent the capabilities of the game engine.  The Python programming language is open source and free to use, even for commercial products.  Python is a multi-platform programing language that runs on Windows, Linux/Unix and Mac OS X operating systems.  A general-purpose programming language, Python is a high-level, dynamic, object-oriented language that beginners find easy to learn.