Archived

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

Roaders

Drawing mesh subsets

Recommended Posts

Roaders    122
I am using this code to draw a mesh that has many sub sets: (LPD3DXMESH g_pMeshTruck) for( DWORD i=0; iSetMaterial( &g_pMeshTruckMaterials ); g_pd3dDevice->SetTexture( 0, g_pMeshTruckTextures[i] ); // Draw the mesh subset g_pMeshTruck->DrawSubset( i ); } When I am looping through the subsets is there any way I can get the name of the subset? Basically it is a truck that I saved from 3DS MAX, in 3DS one of the subsets had the name RLights. WHne the brakes are on I want to change the material of RLights so it looks like the break lights are on. How do I find out what the index of the lights are? Thanks Giles Roadnight giles.roadnight.name

Share this post


Link to post
Share on other sites
juhaszt    122
I use the name of the texture to find out which subset will be rendered in that step. So I can change the material as I need before rendering that subset!

Share this post


Link to post
Share on other sites