help with D3DXComputeTangentFrameEX

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

Recommended Posts

i cant get computetagentframeex to work, it returns D3DERR_INVALIDCALL, and i also dont know how to fill in some of the parameters. i was wondering if someone could help me. heres how i call the function: sorry if the code looks ugly i couldnt format it right for some reason
[source="c++"]

LPD3DXBUFFER buffer=NULL;

HRESULT hr;

hr=D3DXComputeTangentFrameEx(modl,
D3DDECLUSAGE_TEXCOORD,0,
D3DDECLUSAGE_TANGENT, 1,
D3DDECLUSAGE_BINORMAL, 2,
D3DDECLUSAGE_NORMAL,3,
cos(1.57f),
0.1f,
cos(1.57f), &mod, &buffer);

if(FAILED(hr))
{
if(hr==D3DERR_INVALIDCALL) state=NULL;
return;
}


and this is the vertex type used with the meshes
[source="c++"]
#define D3DFVF_BUMPVERTEX D3DFVF_XYZ | D3DFVF_NORMAL| D3DFVF_TEX4|D3DFVF_TEXCOORDSIZE2(0)|D3DFVF_TEXCOORDSIZE3(1)
|D3DFVF_TEXCOORDSIZE3(2)|D3DFVF_TEXCOORDSIZE3(3)

struct bumpvertex
{
VEC pos;
VEC nor;
FLOAT u,v;
VEC tangent;
VEC binormal;
VEC normal;
};


im doing something wrong, can you help and please explain the function to me properly.

Share on other sites
Try linking with D3DX9D.LIB rather than D3DX9.LIB then run your app in the debugger with the debug D3D runtime enabled.

D3DX9D.LIB is the debug version of the D3DX library - when it returns an error code, it will output the reason *why* the error was returned to the Output window of your debugger.

D3DERR_INVALIDCALL is usually returned when one of the parameters you pass is wrong - the debug version of D3DX should give you a clue about which parameter it doesn't like.

Share on other sites
yeh i had it on but i wasnt using it *slaps himself in the head*

it says "u partial channel not in output mesh"

which means ive got the fvf and vertex structure wrong, could you have
a look at it to see if there is anything wrong?

• 36
• 12
• 10
• 10
• 9
• Forum Statistics

• Total Topics
631359
• Total Posts
2999539
×