Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

LittleFreak

D3DXIntersect Error

This topic is 5223 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

Im getting a error with visual studio 6 saying that D3DXIntersect doesnt take 8 parameters. Im using DX9sdk but programing in DX8 does that make a differnce. Any1 know whats wrong?

Share this post


Link to post
Share on other sites
Advertisement
That function is implemented differently in the directX 9.0 sdk, look in both sdks for the parameters. If there is a different function prototype in any of them, try that one instead...

Share this post


Link to post
Share on other sites
doing some research look through the SDKs it all has 10 parameter. But im using one of the premierpress books and it says:

HRESULT D3DXIntersect(
LPD3DBASEMESH pmesh,
CONST *D3DXVECTOR3(XPos,YPos,ZPos),
CONST *D3DXVECTOR3(0.0f, -1.0f, 0.0f),
BOOL *Hit,
DWORD *FaceIndex,
FLOAT *u,
FLOAT *v,
FLOAT *Dist);

But the SDK says

HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit,
DWORD *pFaceIndex,
FLOAT *pU,
FLOAT *pV,
FLOAT *pDist,
LPD3DXBUFFER *ppAllHits,
DWORD *pCountOfHits);

Is this book I payed $60 for and spent about 10 hours now reading all a bunch of BS?

Share this post


Link to post
Share on other sites
Just tack ", NULL, NULL" on to the end of your parameter list. The last few params are for multiple intersections.
It looks like you''re doing a terrain mesh anyway so you probably won''t need that.

Share this post


Link to post
Share on other sites
quote:

Im using DX9sdk but programing in DX8 does that make a differnce.



I''m still puzzled as to why people do this, short of having a video card that doesn''t support DX9. DX8 code can be moved to DX9 by changing a few interface names, and the rest shouldn''t need to be changed.

*boggle*

Share this post


Link to post
Share on other sites
quote:
Original post by LittleFreak
doing some research look through the SDKs it all has 10 parameter. But im using one of the premierpress books and it says:

HRESULT D3DXIntersect(
LPD3DBASEMESH pmesh,
CONST *D3DXVECTOR3(XPos,YPos,ZPos),
CONST *D3DXVECTOR3(0.0f, -1.0f, 0.0f),
BOOL *Hit,
DWORD *FaceIndex,
FLOAT *u,
FLOAT *v,
FLOAT *Dist);

But the SDK says

HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit,
DWORD *pFaceIndex,
FLOAT *pU,
FLOAT *pV,
FLOAT *pDist,
LPD3DXBUFFER *ppAllHits,
DWORD *pCountOfHits);

Is this book I payed $60 for and spent about 10 hours now reading all a bunch of BS?
No - DirectX9 is not overly different to DirectX8. There are some changes to the parameter lists of some functions that you will doubtlessly come across (like D3DXIntersect) and stuff added that you may not come across for a while like the High Level Shader Language (HLSL). You can just see what you need from the SDK documentation. A lot of the time you just need to add a few NULL parameters to your function calls.

IMO you shouldn''t really use a function without trying to understand what it / each of it''s parameters does anyway.

Share this post


Link to post
Share on other sites
quote:
Original post by __Daedalus__
IMO you shouldn''t really use a function without trying to understand what it / each of it''s parameters does anyway.

For some people, it''s easier to dive head first then swim back to the top. They get to see the end result and get a sense of worth for what they''re about to try to understand. Makes the learning process much easier / faster.

I think going with the 8 SDK is a good thing if your book is going that way. But don''t use the 9-docs. Use the same docs as the version you''re using. Google for them.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!