The title only explains half my problem, so let me explain in a little detail.
My current 3d RPG project is using a lot of custom written functions. Such as a fractal landscape generator, a function to shift a mesh around and deform it to the landscape shape to create the illusion of a massive rolling landscape, a function to find the height of the ground at a given x/z co-ordinate and a function to find the intersection point of a straight line with the landscape, all using a custom written heightmap.
My problem is that I want to do collision between a sphere and the landscape to find not only whether a collision has occured, but approximately where it occured so I can consider collision response. Now, since the actual mesh only exists infront of the camera, I want to work it out from the heightmap data I'm using.
I realise that the simplest solution might be to transform the heightmap data into a mesh and use something like Nuclear Glory. Two problems are there:
1) It defeats the object of having a dynamic mesh to trick you into thinking the landscape is bigger then it really is.
2) Turning it into a mesh would result in over 8 million polys, calculating collision with that many polys is just a bit silly.
Now, since the entire landscape is basically a huge grid, I can work out exactly which grid squares the sphere is within the boundaries of, and I want to work the collisions from that. But I'm completely stuck as to how to perform the checks. I can work out a set of 9 squares totally 18 polys around the sphere that I could collide with but that leaves me with the original problem. I don't know how to work out the collision.
I've searched with google and found nothing but either useless pages, pages that require paid logins, or pages full of more mathmatical jargon then you could find in David Brabbem's note-book, oh and the odd porn page that google throws in for some reason.
I've also searched the cobebase here and found only some source code that unforunately uses DBPro's built in mesh collision functions, which requires a mesh to be setup.
If anyone can help, I'd appreciate it.
Thanks
Avan
I don't suffer from insanity:
I enjoy every minute of it!