Indices and vertices

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kjkrum
Posts: 26
Joined: Wed Oct 29, 2003 5:34 pm

Indices and vertices

Post by kjkrum »

I'm a total noob to 3D graphics, and studying the code of CGeometryCreator and CMeshBuffer. Am I correct that index arrays (e.g., line 24 of CGeometryCreator.cpp) determine which vertices are joined into polys? Does their order determine the facing of the poly, or is that determined by the direction of the vertices? (For that matter, are vertices points or vectors? My understanding so far is that they're vectors.)
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Yes, indices decide what vertices in an array make triangles. And yes, order of indices determines the facing.
kjkrum
Posts: 26
Joined: Wed Oct 29, 2003 5:34 pm

Post by kjkrum »

Thanks. So, looking at the textured face, do the vertices go clockwise or anticlockwise?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Irrlicht uses clockwise front-facing. Also, vertices are points, not directions. But since they are given in object coordinate system, they are relative to the local (0,0,0), and hence there's no difference here.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

hybrid wrote:Irrlicht uses clockwise front-facing.
Are you sure on that? I am building my faces counterclockwise so far and it's working. That is if I assume front is positive axis facing.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

arras wrote:
hybrid wrote:Irrlicht uses clockwise front-facing.
Are you sure on that? I am building my faces counterclockwise so far and it's working. That is if I assume front is positive axis facing.
I can confirm this, I recognised this at work for IrrOpenSteer...
when I created the vehicle mesh (circle with arrow) I first created the arrow shape counter clockwise and I was wandering why no face was seen until I found out that I had to create them clockwise... :shock:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Right. Made some tests, it's clockwise. I had false impression that it's counter cw since I always faced "front", that is along Z axis while setting vertices/indices but looked opposite to see face. So I was building it clockwise in fact.
Post Reply