Huge dataset point in polygon in .net (collision detection)
- by Rickard Liljeberg
I have a pretty big mesh with polygons, usually triangles but sometimes rectangles. Each point in my mesh has a value (value has nothing to do with coordinates).
Now I am creating a second mesh in the same coordinate-space as the old mesh. I now want to interpolate out values for all points (vertices) in the new mesh using the values from the old mesh.
Now I could loop each polygon in the new mesh and detect which old vertices are in each polygon by making 2d collision detection (altho even this I don't get to function properly so if anyone has simple and fast code for 2d collision detection (triangle is enough) I would gladly see it).
However to my main point again. looping each old vertice for each new polygon seems less than efficient. is there a better way?