Game Development Reference
In-Depth Information
srf->b = (BYTE)(atof(tokens[3].name)*255.0);
continue;
}
if (line.Find("MATERIAL_SPECULAR")!=-1){
if (ParseTokens(line, tokens, 5)<4) return FALSE;
srf->specular = (float)atof(tokens[1].name);
continue;
}
if (line.Find("MATERIAL_TRANSPARENCY")!=-1){
if (ParseTokens(line, tokens, 5)<2) return FALSE;
srf->transparency = (float)atof(tokens[1].name);
continue;
}
if (line.Find("MAP_DIFFUSE")!=-1){
srf->tex = new TEXTURE;
if (!srf->tex) return FALSE;
memset(srf->tex, 0, sizeof(TEXTURE));
if (!FindToken(file,line,"BITMAP")) return FALSE;
if (ParseTokens(line, tokens, 5)<2) return FALSE;
strcpy(srf->tex->name, tokens[1].name);
continue;
}
if (line.Find("NUMSUBMTLS")!=-1){
AfxMessageBox("3DS Loading error::
Only a single layer of sub materials allowed");
return FALSE;
}
}
file.Seek(start, CFile::begin);
return TRUE;
}
Reading the GEOMOBJECT section
We have read some basic details about the scene and the material list,
now we can read the geometry. In the class C3DSAscii, the function
ReadObject is used whenever the token GEOMOBJECT is found. This
function looks for the tokens NODE_NAME, NODE_PARENT, NODE_TM,
MESH, TM_ANIMATION, MATERIAL_REF and WIREFRAME_COLOR.
Search Nedrilad ::




Custom Search