• Advertisement
Sign in to follow this  

Do I Have To Normalize The Direction Vector For D3Dxboxboundprobe?

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

Do I need to normalize the direction vector for this function called D3DXBoxBoundProbe?

 

Update:

After looking in the MSDN, it says it doesn't need to...

https://msdn.microsoft.com/en-us/library/windows/desktop/bb172713(v=vs.85).aspx

 

Update2:

When I was iterating all the bounding boxes in my octree, there are several simultaneous hits by the same ray.

How do I pick the bounding box that is closest to the pivot?

 

Thanks

Jack

bHit = D3DXBoxBoundProbe(&vMin, &vMax, &this->getRelPivot(), &D3DXVECTOR3(-1, -1, 1));
Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

Update2: When I was iterating all the bounding boxes in my octree, there are several simultaneous hits by the same ray. How do I pick the bounding box that is closest to the pivot?

 

You will probably get much better responses to this question if you post it as a separate topic. 

 

You could store a list of all the boxes that the ray hits, and choose whichever has the shortest distance between the ray's source and the box' centre. If you are doing this hierachially, which I assume you are since it's an octree, then I think the most hits you can get is 3 but don't take my word on that as I am getting very confused trying to work it out in my head. Easiest option would probably be to store only the 'closest so far'.

Share this post


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

  • Advertisement