Original Post
I'm using this function to do landscape picking, but it's not returning what I expect it to on the u,v parameters (the t is perfect).
I'm doing a quad-tree cull type of thing to speed up the landscape picking, and creating a large quad 80x80 units. This gets split into two tris, which I pass to the IntersectTriangleCull function.
The IntersectTriangleCull function records a ray hit from the mouse on one or the other of the tris, and correcly returns the t (height) of the intersection, but the u and v coordinates are coming back with figures like 0.5 and 0.000003, instead of the expected values (e.g. 10,10).
If anyone can help, it would be fantastic.
btw, for interest's sake, I was doing this on a per triangle basis testing hits against the terrain, but it was seriously slow. Now I'm using a quad-tree type of thing so that I only have to check a handful of actual terrain triangles. The problem is that if the terrain is seriously jagged, the quad-tree culls in the wrong place... that is, if there is mountain in the center of a quad, the intersect is first trapped on the adjacent quad further away, and then it continues to refine the intersection on that quad, instead of the one with mountain. Any way around this?
[edited by - Nottaxes on October 30, 2002 6:42:34 AM]