Skip to main content
gamedev.net
🔒 Locked

D3DXCreateBox texturing problems

Started by FuzzyBunny May 27, 2003 at 3:40 PM 2 replies 2.3k views
Original Post
FuzzyBunny
FuzzyBunny
Hi all, I have a mesh interface: LPD3DXMESH m_pMesh; Then i use the D3DX function D3DXCreateBox to create a box primitive, then render using m_pMesh->DrawSubset(0); everythng work ok, until i try to use textures, when i set a texture and do DrawSubset the texture flickers, and does appear in some places at all, so the whole thing looks really really messed up.. Any idea why? I set all the render states, I set the VertexShaderFVF to m_pMesh->GetFVF();, but the whole thing is messed up. I have my own CCube class with a Vetex Buffer, and I can render textured cubes no problem, but if I use the LPD3DXMESH and try to use textures, it doesn''t work.... please, any feedback is appreciated, and thanks in advance, ~Dima
FuzzyBunny
FuzzyBunny
hi, and thanks for the reply...

I tried cloning teh mesh using:

#define SHAPE_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)

pMesh->CloneMeshFVF(D3DXMESH_MANAGED, SHAPE_D3DFVF_CUSTOMVERTEX, m_pD3DDevice, &m_pMesh);

after cloning the texture does not appear at all. The flickering is gone and it''s just the material...

so Im guessing D3DX does not create texture coordinates for the shapes it creates???? Any way to make it automatically generate coords? am I missing something?

thanks for any help in advance!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.