Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

D3DXIntersect

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

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 ); 1 this function has many parameter. I just wanna the coordinate of intersect point. so are the pU pV pFaceIndex ppAllHits pCountOfHits unuseful? Do I still need deine variable for the output parameter? It seem it can not be set 0 if you do not need them. 2. it is ppAllHits data type typedef struct _D3DXINTERSECTINFO { DWORD FaceIndex; FLOAT U; FLOAT V; FLOAT Dist; } D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO; it seem ppAllHits has also pu pv dist, what is different between ppAllHits and FLOAT *PU ,PV pDist?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by luasitdown
this function has many parameter. I just wanna the coordinate of intersect point. so are the pU pV pFaceIndex ppAllHits pCountOfHits unuseful?
Do I still need deine variable for the output parameter?
It seem it can not be set 0 if you do not need them.

If all you want is the closest intersection point, then the only thing you need is the "pDist" value. The intersection point can then be found by:

Point = vOrigin + (*pDist)*vRay;

I think only the last two parameters could be set to NULL.
Quote:
Original post by luasitdown
2. it is ppAllHits data type
typedef struct _D3DXINTERSECTINFO {
DWORD FaceIndex;
FLOAT U;
FLOAT V;
FLOAT Dist;
} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO;

it seem ppAllHits has also pu pv dist, what is different between ppAllHits and
FLOAT *PU ,PV pDist?

Depending on the mesh, a ray could intersect the mesh at more than one point. This array of intersection structures gives details about each point of intersection. The pU, pV, and pDist parameters give information about the closest point of intersection.

neneboricua

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!