Consider a cube with faces we'll call "left", "right", "front", "back", "top" and "bottom".
The cube can be described by $0 \le x,y,z \le 1$.
To name the faces, we'll say $x$ extends to the right, $y$ to the top and $z$ forward:
Given a face/plane (for example, $x=1$ or $y=0$), I want to generate an ordered list of vertices of that face, such that they proceed counter-clockwise around the face of the cube if you were to look at the cube -- that is from some point outside $(0,1)$.
For example, one such ordering for the right face ($x=1$) would be:
{1,0,0}, {1,1,0}, {1,1,1}, {1,0,1},
while one such ordering for the left face($x=0$) would be:
{0,0,0}, {0,0,1}, {0,1,1}, {0,1,0},
Note that in the first ordering, we go from $(y,z) = (0,0)$ to $(1,0)$.
While in the second we go from $(y,z) = (0,0)$ to $(0,1)$.
This is because of the counter-clockwise restriction.
I'm fairly certain I can somehow use the normal of the face (in the above case <1,0,0>) to compute these, and I'm thinking it has something to do with a cross product somewhere, but after that I'm lost.
Any guidance would be greatly appreciated. Thanks in advance.