Identify Vertices

Blitz3D Forums/Blitz3D Programming/Identify Vertices

TartanTangerine (was Indiepath)(Posted 2003) [#1]
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..


Rob(Posted 2003) [#2]
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.


TartanTangerine (was Indiepath)(Posted 2003) [#3]
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..


Rob(Posted 2003) [#4]
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.


Al Mackey(Posted 2003) [#5]
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.