Archived

This topic is now archived and is closed to further replies.

HellRiZZer

Milkshape rendering mode..

Recommended Posts

Hey all, I was wandering how does Milkshape Modeller renders models? I mean, what settings it have for materials, lighting and such? What I do is I set Ambient, Diffuse and Specular to the color I need, and Milkshape renders it with some shades, but when I try to render same loaded model (with same colour values for A/D/S) it doesn''t want to render in same way as it renders in Milkshape. What''s wrong? Here''s my code (I render without texture, only material):
  
// Rendering procedure for Model

int face_count = 0;
			for ( int i = 0; i < m_numMeshes; i++ )
			{
				int materialIndex = m_pMeshes[i].m_materialIndex;
					
glDisable(GL_TEXTURE_2D);
			glEnable(GL_LIGHTING);
			glMaterialfv( GL_FRONT, GL_AMBIENT,	 m_pMaterials[materialIndex].Ambient	);
			glMaterialfv( GL_FRONT, GL_DIFFUSE,	 m_pMaterials[materialIndex].Diffuse	);
			glMaterialfv( GL_FRONT, GL_SPECULAR, m_pMaterials[materialIndex].Specular	);
// Those point to float value[4]

				
		
				glLoadName(ID);		// Load Our Object''s ID For Picking

				
				glBegin( GL_TRIANGLES );
				
					for ( int j = 0; j < m_pMeshes[i].m_numTriangles; j++ )
					{
						int triangleIndex = m_pMeshes[i].m_pTriangleIndices[j];
						Triangle* pTri = &m_pTriangles[triangleIndex];
						
						for ( int k = 0; k < 3; k++ )
						{
							int index = pTri->m_vertexIndices[k];
							
							glNormal3fv( pTri->m_vertexNormals[k] );
							glTexCoord2f( pTri->m_s[k], pTri->m_t[k] );
							glVertex3fv(  m_pVertices[index].Pos);
						}
					}
				
				glEnd();
			}


  
Thanks. " Do we need us? "

Ionware Productions - Games and Game Tools Development

Share this post


Link to post
Share on other sites