Game Development Reference
In-Depth Information
double tmp1 = rotaxis.x*rotaxis.y*omc;
double tmp2 = rotaxis.z*s;
m10 = tmp1 - tmp2;
tmp1 = rotaxis.x*rotaxis.z*omc;
tmp2 = rotaxis.y*s;
m02 = tmp1 - tmp2;
m12 = tmp1 + tmp2;
if (m10==0.0) m10=0.00000001;// Avoid division by zero
tmp1 = m12/m10;
euler.x = asin(-m12);
euler.y = asin(m02 * tmp1);
euler.z = acos(m11 * tmp1);
}
Reading the MESH section
The MESH section contains the tags MESH_NUMVERTEX, MESH_
VERTEX_LIST, MESH_NUMFACES, MESH_FACE_LIST, MESH_NUMT-
VERTS, MESH_TVERTLIST, MESH_NUMTVFACES, MESH_TFACELIST
and MESH_NORMALS. MESH_NUMVERTEX, MESH_NUMFACES,
MESH_NUMTVERTS and MESH_NUMTVFACES are all single integer
values giving the number of vertices, faces, texture vertices and textured
faces respectively. Each of the lists is handled by a dedicated function call
that we will examine in turn. Reading the normals section is handled by the
function ReadNormals .
BOOL C3DSAscii::ReadMesh(CStdioFile &file, CToon3DObject *obj)
{
CString line;
int start,end, numtverts, numtvfaces;
TOKEN tokens[5];
TEXVEC *tvert = NULL;
start = file.GetPosition();
end = GetSectionEnd(file);
while(file.GetPosition()<(UINT)end){
file.ReadString(line);
Search Nedrilad ::




Custom Search