Before you ask:
The Model is loaded correctly (when rotated certain parts fall in and out of view)
http://img.photobucket.com/albums/v1...o/ModelBug.jpg
Eh?
Here is my draw thingy
Code:
void Draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity ();
gluLookAt( 65, 65, 65, 0, 0, 0, 0, 1, 0 );
Model1->DrawMS3DModels();
glFlush ();
}
And here is the DrawMS3DModels() functon
Code:
void MS3DModel::DrawMS3DModels()
{
GLboolean texEnabled = glIsEnabled( GL_TEXTURE_2D );
for ( int i = 0; i < NumMeshes; i++ )
{
int materialIndex = Meshes[i].MaterialIndex;
if ( materialIndex >= 0 )
{
glMaterialfv( GL_FRONT, GL_AMBIENT, Materials[materialIndex].Ambient );
glMaterialfv( GL_FRONT, GL_DIFFUSE, Materials[materialIndex].Diffuse );
glMaterialfv( GL_FRONT, GL_SPECULAR, Materials[materialIndex].Specular );
glMaterialfv( GL_FRONT, GL_EMISSION, Materials[materialIndex].Emissive );
glMaterialf( GL_FRONT, GL_SHININESS, Materials[materialIndex].Shininess );
if ( Materials[materialIndex].Texture > 0 )
{
glBindTexture( GL_TEXTURE_2D, Materials[materialIndex].Texture );
glEnable( GL_TEXTURE_2D );
}
else
glDisable( GL_TEXTURE_2D );
}
else
{
glDisable( GL_TEXTURE_2D );
}
glBegin( GL_TRIANGLES );
{
for ( int j = 0; j < Meshes[i].NumTriangles; j++ )
{
int triangleIndex = Meshes[i].TriangleIndices[j];
const Triangle* pTri = &Triangles[triangleIndex];
for ( int k = 0; k < 3; k++ )
{
int index = pTri->VertexIndices[k];
glNormal3fv( pTri->VertexNormals[k] );
glTexCoord2f( pTri->Textures1[k], pTri->Textures2[k] );
glVertex3fv( Vertices[index].Location );
}
}
}
glEnd();
}
if ( texEnabled )
glEnable( GL_TEXTURE_2D );
else
glDisable( GL_TEXTURE_2D );
}
If you need it I can post the LoadModelData() function, but I'm almost 85% sure its not that
Why does it look like that? Certain parts seem to be cut off of the viewport?
BTW The model is a 3d Cross