简体   繁体   中英

Is there a raycasting library in C++ that is simple and open source?

I'm looking for a library that will let me cast a ray into a scene model (it happens to be a terrain model in our case) and return the point of intersection in the scene. It does not have to be super-efficient (although I'd rather it not be super-inefficient). Ideally it would not have dependencies on other libraries (like OpenGL). I'm really looking for something that has just the functionality I need and no more.

Does anyone have any suggestions?

Unless there are other requirements you haven't revealed, use CGAL 's AABB tree 's support for ray intersections ( example ).

(Please, don't even think about using this if you're actually trying to do terrain rendering though... there are far more efficient algorithms for ray-casting height fields for the purpose of producing images eg so-called voxel algorithms ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM