devel/CSGLib/src/Solid.cpp
/** Creates a geometry based on the indexes and vertices set for the solid */
Creates a geometry based on the indexes and vertices set for the solid
Creates a geometry based on the indexes and vertices set for the solid
void Solid::defineGeometry()
{
	int nNumTriangles = indices.GetSize() / 3;
	for(int i = 0; i < nNumTriangles; i++)
	{
		int nIndex1 = *indices.GetInt(i * 3 + 0);
		int nIndex2 = *indices.GetInt(i * 3 + 1);
		int nIndex3 = *indices.GetInt(i * 3 + 2);
		mlVector3D vP1 = *vertices.GetVector(nIndex1);
		mlVector3D vP2 = *vertices.GetVector(nIndex2);
		mlVector3D vP3 = *vertices.GetVector(nIndex3);
		float fScale = 20.0f;
		mlVector3D vTranslation(50,20,50);
		vP1 *= fScale;
		vP2 *= fScale;
		vP3 *= fScale;
		vP1 += vTranslation;
		vP2 += vTranslation;
		vP3 += vTranslation;
		gxColor col1 = *colors.GetColor(nIndex1);
		gxColor col2 = *colors.GetColor(nIndex2);
		gxColor col3 = *colors.GetColor(nIndex3);
	}
}
void Solid :: defineGeometry ( ) { int nNumTriangles = indices . GetSize ( ) / 3 ; for ( int i = 0 ; i < nNumTriangles ; i ++ ) { int nIndex1 = * indices . GetInt ( i * 3 + 0 ) ; int nIndex2 = * indices . GetInt ( i * 3 + 1 ) ; int nIndex3 = * indices . GetInt ( i * 3 + 2 ) ; mlVector3D vP1 = * vertices . GetVector ( nIndex1 ) ; mlVector3D vP2 = * vertices . GetVector ( nIndex2 ) ; mlVector3D vP3 = * vertices . GetVector ( nIndex3 ) ; float fScale = 20.0f ; mlVector3D vTranslation ( 50 , 20 , 50 ) ; vP1 *= fScale ; vP2 *= fScale ; vP3 *= fScale ; vP1 += vTranslation ; vP2 += vTranslation ; vP3 += vTranslation ; gxColor col1 = * colors . GetColor ( nIndex1 ) ; gxColor col2 = * colors . GetColor ( nIndex2 ) ; gxColor col3 = * colors . GetColor ( nIndex3 ) ; } }
Creates a geometry based on the indexes and vertices set for the solid
Creates a geometry based on the indexes and vertices set for the solid
// Need to send data to the gxModel // Maybe this should inherit from it! (Since Solid inherits from Shape3D) // Incidentally, do the normals get used by the boolean modeller? Of course they do! // Refresh the model. // Wipe the model //@@	m_pModel->Clear(); // Iterate all the triangles, and make the fuckers //@@		m_pModel->m_triangles.push_back(gxRenderingTriangle(col1, col2, col3, vP1, vP2, vP3));