#### Archived

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

# 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.

## 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 on other sites
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 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 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.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 9
• 23
• 9
• 32
• ### Forum Statistics

• Total Topics
632623
• Total Posts
3007501
• ### Who's Online (See full list)

There are no registered users currently online

×