Game Development Reference
In-Depth Information
outFile << std::endl << std::endl;
}
The following text comes from the Mesh Dump.txt file for this sample
application and corresponds to the data written by dumpAttribute-
Table .
Attribute Table:
----------------
Entry 0
------------
Subset ID: 0
Face Start: 0
Face Count: 4
Vertex Start: 0
Vertex Count: 8
Entry 1
------------
Subset ID: 1
Face Start: 4
Face Count: 4
Vertex Start: 8
Vertex Count: 8
Entry 2
------------
Subset ID: 2
Face Start: 8
Face Count: 4
Vertex Start: 16
Vertex Count: 8
We can see that this matches the data that we specified for the mesh—
three subsets with four triangles per subset. We advise you to examine
the entire output Mesh Dump.txt file for this sample. It can be found in
this sample's folder in the companion files.
Finally, we can easily render the mesh using the following code;
essentially we just loop through each subset, set the associated texture,
and then draw the subset. This is easy since we specified the subsets in
the order 0, 1, 2, …, n - 1 , where n is the number of subsets.
bool Display(float timeDelta)
{
if( Device )
{
//...update frame code snipped
Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
0x00000000, 1.0f, 0);
Device->BeginScene();
for(inti=0;i<NumSubsets; i++)
Search WWH ::




Custom Search