Sign in to follow this  

help with D3DXComputeTangentFrameEX

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

If you intended to correct an error in the post then please contact us.

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++"]
  modl->GenerateAdjacency(0.001f, adjacency);

  LPD3DXBUFFER buffer=NULL;

  HRESULT hr;

  hr=D3DXComputeTangentFrameEx(modl,
D3DDECLUSAGE_TEXCOORD,0, 
D3DDECLUSAGE_TANGENT, 1,
D3DDECLUSAGE_BINORMAL, 2, 
D3DDECLUSAGE_NORMAL,3,
NULL, adjacency,  
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 this post


Link to post
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 this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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