Sign in to follow this  
dave

D3DXCreateCylinder(), Teapot, Box

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this