Posted by Labrasones
on 21 December 2011 - 10:43 AM
3) When editing the terrain, how to optimize the intersection tests? Currently i just cast a ray and find the intersected triangle, then i loop through all the terrain vertices and test their distance to the point of intersection to find if the vertex is within the radius of the editing brush. This works fine for now (32k vertices) but i'm worried about larger terrains. And i still have to add the code for recalculating normals.
I may be WAY off here, as I'm still new. But aren't height-map terrains generated from a grey scale image? If so, would it not be possible to paint the image representing the height? It might be more work to implement texture painting capabilities into your game, but if you do, you might be able to use it to edit terrain textures as well. Again, I'm still really new, but that's how I always thought terrain editors worked.