• Advertisement
Sign in to follow this  

DrawPrimitive Messing up textures

This topic is 4756 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on something that uses two different methods to draw meshes. Here are some excerpts One: D3DXMatrixTranslation(&matPos, xpos, 0.0, zpos); g_d3d_device->SetTransform(D3DTS_WORLD,&matPos); D3DXMatrixScaling(&matPos, xsize, 1.0, zsize); g_d3d_device->MultiplyTransform(D3DTS_WORLD,&matPos); g_d3d_device->SetStreamSource(0,floor_vb,0,sizeof(mesh_vertex)); g_d3d_device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2); and Two: g_d3d_device->SetMaterial( &Target->Materials ); g_d3d_device->SetTexture( 0, Target->Textures ); Target->TheMesh->DrawSubset(i); My problem is that whenever I use the second method, it screws something up and the textures are messed up for objects drawn with the first method. I've narrowed it down to the DrawSubset line. When that is commented out, the textures are still good for objects drawn with the first method. Any one familiar with this? I'm thinking DrawSubset does some sort of texture scaling or something that remains when I try the DrawPrimitive. Thanks, ~Raised

Share this post


Link to post
Share on other sites
Advertisement
I guess you also have to set other states like the texture cascade. Check the SetTextureStageState for more information. I suggest checking some texturing tutorials.

Luck!
Guimo

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement