I am trying to generate a procedural mesh for box. But it seems winding order is invalid or I am missing something.
As an example the components of a mesh with 1 triangle:
Using this setup, a triangle facing down(0 0 -1) is generated. But I think it must be facing up in the left handed coordinate system because as far as I know if you wrap your left hand fingers around the triangle following this order; your thumb finger will point upwards.
Am I missing something?
yep, i also missing the logic on this one…
You’re going clockwise, you need to set the order counter clockwise:
I’ve already understood this. But I’ve asked why? It is a left handed coordinate system. It should have been in CW order.
Not necessarily, no. A winding order convention can be either clockwise or counter-clockwise, in either a left-handed or right-handed coordinate system. There is no natural correspondance between them. Any of the four combinations is valid.
Also you can talk about the winding order after the triangle is projected onto a 2D screen, but again this is dependent on the screen space coordinate system (where is screen=(0,0) and is up the screen positive or negative) . See here for example: VkFrontFace(3)
The “framebuffer coordinates” mean the 2D screen coordinates.
FYI Unreal uses VK_FRONT_FACE_CLOCKWISE in the Vulkan RHI but in order to know what that means you need to know how the framebuffer is configured.
(The quickest way is just to try both winding orders for a given renderer to see which way it wants it and then move on.)