Help needed with D3D10_INPUT_ELEMENT_DESC

Started by
1 comment, last by ankhd 15 years, 1 month ago
Hi all. I seem to be having trouble with the DirectX 10 Skinning10 Sample I think I have it all set up to how the sample sets it up but I cant find the samples vertex type, they use to load the mesh with, just Bytes* But I need a D3D10_INPUT_ELEMENT_DESC to pass to D3DX10CreateMesh The fx file that the sample uses is set out like so... Shader.


struct VSSkinnedIn
{
    float3 Pos	: POSITION;			//Position
    float4 Weights : WEIGHTS;		//Bone weights
    uint4  Bones : BONES;			//Bone indices
    float3 Norm : NORMAL;			//Normal
    float2 Tex	: TEXCOORD;		    //Texture coordinate
    float3 Tan : TANGENT;		    //Normalized Tangent vector
};

struct VSStreamOut
{
    float4 Pos	: POSITION;			//Position
    float3 Norm : NORMAL;			//Normal
    float2 Tex	: TEXCOORD;		    //Texture coordinate
    float3 Tangent : TANGENT;		//Normalized Tangent vector
};



Im not sure if my vertex structure matches the VSSkinnedIn here is mine


struct SkinningVertex
{
	
    D3DXVECTOR3 Pos;
    float Weights;
    float Bones;
    D3DXVECTOR3 Norm;
    D3DXVECTOR2 Tex;
    D3DXVECTOR3 Tangent;
	
};

Advertisement
change float Bones to unsigned int Bones[4] (uint4 is an array of 4 unsigned ints) and float Weights to D3DXVECTOR4 Weights
Thanks. The only problem I have now is setting the bone index and there weights.
I'm currently setting the bone like so.
Bones[0] = Bones[1] = Bones[2] = Bones[3] = boneindex;
I do the same with each weight I set all 4 members to the same influences.
It does render but is not at right position and the annimations not working.
I'll now work on annimation. Thanks for the help, that did the trick.

This topic is closed to new replies.

Advertisement