Hi Murray;
Posted by Muzzer on 27/06/2014 17:29:53:
… I saw Anders' posts about the challenges of determining when the tool had reached the model surface which isn't simple.
Not *that* tough – Code I wrote/modified does it on the GPU, assuming the tool is a cylinder – it does a cylinder/triangle intersection test on all triangles in a shape, and gives a "pushback" vector if the cylinder intersects a triangle.
It was for virtual reality code – so you could bounce off surfaces fairly realistically. It is in the "FreeWRL" open source package, in a file called CollisionGPU.c, if I remember correctly.
I used it recently as part of an internal work project relating to using graphics processors for non-graphics uses.
(Disclaimer – part of the code was written by a bright student I had who is now the director of a quite famous company in California, if I remember correctly – this was in the pre-OpenCL days so his code was not optimized for GPUs, and had some other difficulties, but it was a good starting point for me. Very bright chap this ex-student is…)
All kinds of fun!
JohnS.
Edited By John Alexander Stewart on 27/06/2014 20:33:47