• Advertisement

Archived

This topic is now archived and is closed to further replies.

Counterclockwise - Easy but confusing?!

This topic is 6013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all! I am trying to draw a simple cube made from quads which is going to be a skybox. I want all quads to be rendered counterclockwise! Question which really confuses me - looking at the cube from outside we can see a front face which at the same time could be our back face (behind the viewer) if we were inside the cube. The cube as I mentioned is going to be a skybox, so the camera will be all the time inside the cube. Now.. should I draw the quad counterclockwise from inside which ie: 0.0, 0.0 0.0, 1.0 1.0, 1.0 1.0, 0.0 which looks from outside as we're drawing it clockwise or draw it counterclockwise from outside ie. 0.0, 0.0 1.0, 0.0 1.0, 1.0 0.0, 1.0 which looks form inside as we're drawing it clockwise. Drawing a quad counterclockwise from inside will give the impression looking at it from outside as it is drawn clockwise and the other way round if we were outside of the cube! so, how should I draw it? Edited by - robert_s on September 4, 2001 8:48:18 PM Edited by - robert_s on September 4, 2001 8:49:25 PM

Share this post


Link to post
Share on other sites
Advertisement
The solution is simple: YOU decide first if you want to see your cube from inside (thats the case for skyboxes) or from outside. This will define the vertex order. So simply think from where your primitives are to be seen and set the vertices ccw.
The reason for this step is that the GPU already rejects primitives that face away from the user and hence saves much time in processing them.

- thomas

Share this post


Link to post
Share on other sites

  • Advertisement