How do I find hash value of a 3D vector?

白昼怎懂夜的黑 提交于 2019-12-03 08:21:17

If someone is still interested in this, I figured out a solution that works over here:

http://www.gamedev.net/community/forums/topic.asp?topic_id=567378

The grid approach is going to have problems near the boundaries of the grid boxes. Why not use BSP trees instead?

My preferred hashing function for this kind of vector is to rotate the bits of each component by a different constant and XOR them together.

It's very fast, and the bit rotations are helpful to reduce collisions and ensure as much of the key space as possible is used.

here are a few references you could look at. Warren's papers discuss the hash algorithm in detail:

A parallel hashed Oct-Tree N-body algorithm

A portable parallel particle program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!