## News:

*NEW* Current Version on STEAM16.793

Webchat:
Visit the chat

## X_CULLMODE

#### Hemlos

Quote from: HELP FILEThe "back" is defined as the side of an object that its normal vector is not pointing to. The normal for every triangle in a 3d object is calculated automatically by the graphics engine. When you create a triangle, by drawing its points in an anti-clockwise direction you are telling the graphics engine to point the normal towards the camera rather than away from it.

X_OBJSTART 1
X_OBJADDVERTEX   0,  0, 0,  0,0, RGB(255,255,255)
X_OBJADDVERTEX -20, 40, 0,  0,0, RGB(255,  0,  0)
X_OBJADDVERTEX  20, 40, 0,  0,0, RGB(  0,  0,255)
X_OBJEND

This is quoted from the help file....
In this excerpt the document says must be drawn anti-clockwise, which is counter clockwise i believe.
But the vertex are written in the sample below moving in a clockwise motion.

Should it be drawn clockwise or counterclockwise?
Is cullmode reversed?
Or is the documentation worded wrong?

Bing ChatGpt is pretty smart

#### Kitty Hello

the vertices here are drawn counter clockwise

#### Hemlos

#2
Hmm, whats wrong here is the sample code is showing the vertices are being drawn clockwise, not anti-clockwise:

v2-v3
\  /
v1

Code (glbasic) Select
`X_OBJSTART 1 X_OBJADDVERTEX   0,  0, 0,  0,0, RGB(255,255,255) X_OBJADDVERTEX -20, 40, 0,  0,0, RGB(255,  0,  0) X_OBJADDVERTEX  20, 40, 0,  0,0, RGB(  0,  0,255)X_OBJENDX_MAKE3D 1,20000,90X_CULLMODE 1X_CAMERA 0,1,50, 0,0,0X_DRAWOBJ 1,0SHOWSCREENMOUSEWAIT`

This image #1 shows the order and vertices X and Y, it is the sample object (im not an artist but you can see the idea), this is clockwise.

In image #2: this is a screenshot of this code above.
So i think the problem is, the help file, stating "anti-clockwise".
I was making all my objects backwards because of that word lol

One other thing, can you add a line in X_OBJ... stating a triangle alone in a group must be drawn starting "clockwise", to show the face.