fIND NEAREST VERTEX

Blitz3D Forums/Blitz3D Programming/fIND NEAREST VERTEX

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Just a quick thought ... someone else could prob. elaborate a little better.

#1) use camerapick() to get the entity at point x,y
#2) use pickedtriangle() to get the trianlge you picked from the entity
#3) use pickedX,PickedY,PickedZ to get the world cord. of the pick
#4) use trianglevertex() and grab the 3 vertices of the trianle
#5) transform the vertex cordinates to world cords.
#6) do a distance comparison of the pickedX,Y,Z cordinates to the transformed vertices
#7) the closest one wins ! thats your vertex