How can i know clockwise direction of a face?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
EladarGL
Posts: 0
Joined: Sun May 15, 2005 4:58 pm

How can i know clockwise direction of a face?

Post by EladarGL »

I need to know how i can know face triangle direction (clockwise direction CW or counter clockwise direction CCW). Actually i have five objects, and when i export it (entire scene), it is exported whit different face clockwise direction. When i use this in import java program i must change de direction for each object... Can i control this direction from some site? Thx for reply.

KDR_11k
Posts: 2
Joined: Tue Feb 10, 2004 8:06 pm

Post by KDR_11k »

Use the Flip Normals button in Edit Mode. Make sure that Doublesided is off so you can actually see which faces go where (also try CTRL-N if your mesh has no edges with more than two polies)

reimpell
Posts: 0
Joined: Wed Oct 01, 2003 5:09 pm

Re: How can i know clockwise direction of a face?

Post by reimpell »

EladarGL wrote:I need to know how i can know face triangle direction
Blender utilizes OpenGL for display and therefore uses clockwise vertex winding. However, this only affects the game engine (PKey), not the rendered results. Also, culling based on vertex winiding is disabled if the "Two Sided" face option is set.

cjcurrie
Posts: 0
Joined: Tue Feb 05, 2013 2:34 am

Re: How can i know clockwise direction of a face?

Post by cjcurrie »

reimpell wrote:Blender utilizes OpenGL for display and therefore uses clockwise vertex winding.
Just thought I should mention that the default winding order is a Blender setting, not related to OpenGL.

In OpenGL, you can set the winding order simply with
glFrontFace(GL_CW);
or
glFrontFace(GL_CCW);

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX »

the direction of a face is determined by the order of their vertices

if you flip the normal, the order is changed (reversed)

i needed to change the direction for my exporter (every face), here's the code:

http://code.google.com/p/blender-cod/so ... del.py#500
I'm sitting, waiting, wishing, building Blender in superstition...

Post Reply