swardson
07-18-2005, 04:57 PM
ok all,
I have an interesting problem to solve, and I a bit at a loss of how to do it.
Basicly I am attempting to write a mel script that examines poly objects in the scene and writes a model file in a special format to be read in by another piece of software. This file format is a lot like .obj but different.
I have most of it working, however when I define the list of faces in this model file I need to create it based on an index of the vertex list created:
//this is the vertex list
-0.5 -0.5 0.5
0.5 -0.5 0.5
-0.5 0.5 0.5
0.5 0.5 0.5
-0.5 0.5 -0.5
0.5 0.5 -0.5
-0.5 -0.5 -0.5
0.5 -0.5 -0.5
//this is the face list
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
1 7 8
1 2 8
2 4 8
4 6 8
1 5 7
1 3 5
where each number in the face list corrisponds to the # in the vertex list above. No biggy right. well I need to gather the vertices corrisponding to each face to do that. so I used polyListConponentConversion to do that, but I need the vertices to be read in counter clockwise. the reason for this is that the program importing this file bases its surface normal by reading the vetices counter clockwise, and points the number up based on that.
I am basically wondering how I could read the vertex's associated with the selected face in counter clockwise?
let me know if more information about this would help,
Thanks a bunch, in advance guys
-Brad
I have an interesting problem to solve, and I a bit at a loss of how to do it.
Basicly I am attempting to write a mel script that examines poly objects in the scene and writes a model file in a special format to be read in by another piece of software. This file format is a lot like .obj but different.
I have most of it working, however when I define the list of faces in this model file I need to create it based on an index of the vertex list created:
//this is the vertex list
-0.5 -0.5 0.5
0.5 -0.5 0.5
-0.5 0.5 0.5
0.5 0.5 0.5
-0.5 0.5 -0.5
0.5 0.5 -0.5
-0.5 -0.5 -0.5
0.5 -0.5 -0.5
//this is the face list
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
1 7 8
1 2 8
2 4 8
4 6 8
1 5 7
1 3 5
where each number in the face list corrisponds to the # in the vertex list above. No biggy right. well I need to gather the vertices corrisponding to each face to do that. so I used polyListConponentConversion to do that, but I need the vertices to be read in counter clockwise. the reason for this is that the program importing this file bases its surface normal by reading the vetices counter clockwise, and points the number up based on that.
I am basically wondering how I could read the vertex's associated with the selected face in counter clockwise?
let me know if more information about this would help,
Thanks a bunch, in advance guys
-Brad
