# Face list of a cube?

Page 1 of 1

## 4 Replies - 3648 Views - Last Post: 09 October 2013 - 05:44 AM

### #1 AIintern

Reputation: 0
• Posts: 53
• Joined: 06-June 12

# Face list of a cube?

Posted 03 October 2013 - 04:08 PM

Hello, I was wondering if someone could explain to me how a face list works.

Here is an example for a cube

#vertices
v -1.000000 -1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 -1.000000

#faces
f 1 2 3
f 3 2 4
f 3 4 5
f 5 4 6
f 5 6 7
f 7 6 8
f 7 8 1
f 1 8 2
f 2 8 4
f 4 8 6
f 7 1 5
f 5 1 3

can someone please break this down for me?

Is This A Good Question/Topic? 0

## Replies To: Face list of a cube?

### #2 BetaWar

• #include "soul.h"

Reputation: 1288
• Posts: 7,575
• Joined: 07-September 06

## Re: Face list of a cube?

Posted 03 October 2013 - 04:17 PM

It appears that they are starting off with defining all of the points (for the corners), and then listing all of the faces, as 3 of the vertices previously defined (so each face is 2 triangles).

I expect that, if you plotted the above information out on a piece of graph paper, or in a 3d graphics program, you could come up with a cube where each of the faces consist of 2 triangles (12 faces in total).

### #3 AIintern

Reputation: 0
• Posts: 53
• Joined: 06-June 12

## Re: Face list of a cube?

Posted 03 October 2013 - 07:21 PM

Thank you! I understand it better now, but how do they come up with the order, and how do you know what vertices to start at, and how do you know if to go clock wise or counter clockwise?

### #4 BetaWar

• #include "soul.h"

Reputation: 1288
• Posts: 7,575
• Joined: 07-September 06

## Re: Face list of a cube?

Posted 08 October 2013 - 02:39 PM

The order is probably just the same order they were in when originally creating the object. So, it will be based on what a program thinks is a good order.

The vertices are ordered from 1 to n (12 8 (I can count) in this case) and the faces tell you which vertex to go to next. So that's how you know where to do.

Clockwise/counter-clockwise doesn't matter. They should both draw the same shape... assuming I am understanding that portion of the question.

### #5 baavgai

• Dreaming Coder

Reputation: 6253
• Posts: 13,395
• Joined: 16-October 07

## Re: Face list of a cube?

Posted 09 October 2013 - 05:44 AM

I thought a picture might help.

Sorry, not the best picture. But it should give an idea. I thought about spinning it...

Anyway, faces are labled in my simple wire frame, in the center of the triangle. The triangles defined by the faces are in green. The light grey lines point to the vertices that define the face.

Note, in some systems the order of the vertices are important, as this defines the "face normal." Direct3D does this, for sure.

For the curious, the source use to generate (OpenGL, I had it to hand):
Spoiler