Question about triangle face direction

Blitz3D Forums/Blitz3D Beginners Area/Question about triangle face direction

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Put your triangle at 0,0,0
Put your camera at 0,0,-10

make your camera look at 0,0,0

now you are on the negative z axis looking at an xy plane.
y positive is up

this tri is cw:
(-1,0,0) - (0,1,0) - (1,0,0)

this tri is ccw:
(-1,0,0) - (0,-1,0) - (1,0,0)
Graphics3D 500,500,0,2

cam = CreateCamera()
PositionEntity cam , 0,0,-2
m=CreateMesh()

PointEntity cam,m

s = CreateSurface(m)

v0 = AddVertex(s,-1,0,0)
v1 = AddVertex(s,0,Sqr(2),0)
v2 = AddVertex(s,1,0,0)

;cw:
AddTriangle s,v0,v1,v2

;ccw:
;AddTriangle s,v0,v2,v1

While Not KeyHit(1)
	RenderWorld 
	Flip
Wend