# Do I Have To Normalize The Direction Vector For D3Dxboxboundprobe?

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

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

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

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633678
• Total Posts
3013292
×