CCW or CW?

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

Post Reply
Alli
Posts: 0
Joined: Thu Mar 24, 2005 10:51 pm

CCW or CW?

Post by Alli »

When blender renders, does it render CW or CCW(Clockwise or Counter Clockwise)?

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth »

The internal renderer is a scanline hibrid with secondary ray tracing. It renders from bottom to top.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

Alli
Posts: 0
Joined: Thu Mar 24, 2005 10:51 pm

Post by Alli »

im talking about every quadrangle and triangle, in openGl you draw them CW or CCW wich way does blender use?

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth »

Ah, in the 3D view you mean. Clockwise I think, but don't quote me on that.

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

Alli
Posts: 0
Joined: Thu Mar 24, 2005 10:51 pm

Post by Alli »

Is there anybody who is sure?

bfvietnam
Posts: 0
Joined: Wed Apr 21, 2004 8:54 pm

Hmm

Post by bfvietnam »

The vertex definition direction is a common way of specifying normal direction. If nobody knows, myself included, best thing to do is
go into blender.. Make a cube, starting at 0,0,0 and ending at 1,1,1.. then save it as a VRML file.. Look at the VRML file.. If the vertices in the
cube read for a quad like 0,0,0 - 1,0,0 - 1,1,0 - 0,1,0 .. Then its CCW because the normal is pointing away, downward, for this quad.. If its defined the opposite direction, 0,0,0 - 0,1,0 - 1,1,0 - 1,0,0 .. Then its CW..

This is just a guess.. But usually if models appear flipped in blender dark,
its easy enough flip the normals. But if you have to know, this
method above should work.. If you can't stand VRML, you could try Videoscape format which is ultra simple..

But the question is if the file format has a particular orientation preference..

I don't know, you can experiment..

As for backface culling, blender doesn't use it, unless for rendering, game mode or texturing mode..

Just as a test, I created a quad made of tris, made it single sided,
made sure the normals were pointing downward.. I got this when saving out to wavefront format:

Code: Select all

# Blender OBJ File: k:\untitled.blend
# www.blender.org
mtllib untitled.mtl
o Mesh_Mesh
v 1.0 1.0 0.0
v 1.0 0.0 0.0
v 0.0 0.0 0.0
v 0.0 0.999999523163 0.0
vt 0.0 0.0 0.0
vt 0.0 0.0 0.0
vt 0.0 0.0 0.0
vt 0.0 0.0 0.0
vt 0.0 0.0 0.0
vt 0.0 0.0 0.0
vn 0.0 -3.37174782317e-007 -0.707106769085
vn 0.0 -3.37174782317e-007 -0.707106769085
vn 0.0 -3.37174782317e-007 -0.707106769085
vn 0.0 -3.37174782317e-007 -0.707106769085
vn 0.0 -3.37174782317e-007 -0.707106769085
vn 0.0 -3.37174782317e-007 -0.707106769085
usemtl Grey
f 1/1/1 2/2/2 3/3/3 
f 1/4/4 3/5/5 4/6/6 

Code: Select all

The first face is refering to vertex 1,2 and 3, which is 
v 1.0 1.0 0.0
v 1.0 0.0 0.0
v 0.0 0.0 0.0

0,0  <=  1,0
              ^
              ||
             1,1


This is the correct direction for clockwise (if you are looking
down from above, the normal is on the opposite site) so its like your lefthand.. Fingers curl in the direction of definition, normal is thumb..

This curling fingers with the thumb is a common illustration in computer graphics, if you do a search on google you will find a lot of references to this type of illustration..

In this case, normal points away, which is correct for clockwise
definition..

If this is not the answer you were looking for... Oh well, I tried..
Last edited by bfvietnam on Fri Mar 25, 2005 8:12 pm, edited 3 times in total.

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman »

Aw, I thought you were talking concealed carry licenses.

Post Reply