Updates to tools to move the class FGArray into the lib area so it could
be used by multiple programs. Fixed a triangle loading bug in obj.cxx introduced when I added tri-strip functionality.
This commit is contained in:
parent
7a1e59ae4b
commit
eb81fb7a2d
1 changed files with 12 additions and 6 deletions
|
@ -700,16 +700,22 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
|
||||||
// xglTexCoord2f(pp.x(), pp.y());
|
// xglTexCoord2f(pp.x(), pp.y());
|
||||||
// xglVertex3dv(nodes[n3].get_n());
|
// xglVertex3dv(nodes[n3].get_n());
|
||||||
|
|
||||||
|
if ( token == "tf" ) {
|
||||||
|
// triangle fan
|
||||||
|
fragment.add_face(n1, n2, n3);
|
||||||
|
n2 = n3;
|
||||||
|
} else {
|
||||||
|
// triangle strip
|
||||||
if ( odd ) {
|
if ( odd ) {
|
||||||
fragment.add_face(n1, n2, n3);
|
fragment.add_face(n1, n2, n3);
|
||||||
} else {
|
} else {
|
||||||
fragment.add_face(n2, n1, n3);
|
fragment.add_face(n2, n1, n3);
|
||||||
}
|
}
|
||||||
|
|
||||||
odd = !odd;
|
odd = !odd;
|
||||||
n1 = n2;
|
n1 = n2;
|
||||||
n2 = n3;
|
n2 = n3;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// xglEnd();
|
// xglEnd();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue