D3DXCreateCylinder(), Teapot, Box

Started by
1 comment, last by Xeile 18 years, 10 months ago
I have loaded a cube from an x file and that all loads and renders fine. But when i try and use the Create functions mentioned in the title mesh->DrawSubset() fails and i get the following D3D error: Direct3D9: (ERROR) :Vertex shader function usage (D3DDECLUSAGE_TEXCOORD,0) does not have corresponding usage in the current vertex declaration I have never set any of these declarations since i'm using LPD3DXEFFECT and so far havnt needed to. I have been doing texure blending and am about to move on to diffuse lighting. Anyone got any ideas what this could be caused by? ace
Advertisement
Well if you look at the remarks of the D3DXCreateBox function, you see the following lines:

"This function creates a mesh with the D3DXMESH_MANAGED creation option and D3DFVF_XYZ | D3DFVF_NORMAL flexible vertex format (FVF)."

This means there are no texture coordinates defined in the FVF. If you try to use them, the device probably fail.
Use the ID3DXMesh::CloneMesh function to convert the created cylinder/teapot/whatever to the vertex declaration that you're using. If you're using FVF codes, use ID3DXMesh::CloneMeshFVF. :)
_______________________________________________________________________Hoo-rah.

This topic is closed to new replies.

Advertisement