Identify Vertices

Blitz3D Forums/Blitz3D Programming/Identify Vertices

I am developing a game where a player roams around a landscape, the landscape is made up of a mesh (I do not want to use terrains)

Is there a quick and easy way to identify the vertices of the landscape mesh that are within a defined distance to my players position? I'd like to do landscape deformation when the player gets hit with a bomb etc..

http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=284
this routine simply finds the closest verts to the fake light (a pivot).

Easily modified for your purpose.

It still means that I've got to loop through every vert to find the distance. I might have to setup some kind of vert lookup table to do this quickly..

yeah sounds easy enough, x,z array table which points to a bank of verts. Then with those few verts you know which is closest.

You could also split your ground mesh up into a grid of independent meshes.. then you would only have to loop through the verts of those closest to the player.