[Bf-python] How to get the normal of a face?

Leroy van Engelen leroy at flob.student.utwente.nl
Tue Sep 7 17:31:15 CEST 2004


Hi all,

I am writing a python script that calculates triangle strips from a
model in blender for fast rendering in OpenGL. It's not that advanced,
but it's already able to strip the blender monkey :)

However, there is a problem: I can't figure out the orientation of a
face. Currently I assume all triangles to be defined counter-clockwise,
but of course this will fail miserably if a normal has been flipped in
the model. As far as I know, I can only access the normals of the
vertices (which are the averages of the normals of the neighbouring
faces) and not the normals of the faces.

Is there a way to work around this? I would like to make my script as
robust as possible. I've looked through the archives but I couldn't find
anything about this.

Thanks,

- Leroy van Engelen




More information about the Bf-python mailing list