Keep in mind that this:
is equivalent to this:
The increase in speed presumably happens because LinePick has some overhead when the entities it's concerned with change. An alternate (and marginally faster) optimization would be to perform all your LinePicks before you start moving vertices around.
For n=1 To 1000 vert=Rand(0,CountVertices(sf)) VertexCoords2(sf,vert,Rand(-10,10),Rand(-10,10),Rand(-10,10)) VertexTexCoords2(sf,vert,Rand(-10,10),Rand(-10,10),Rand(-10,10)) LinePick(0,0,0,1,1,1) Next updatemeshes
is equivalent to this:
For n=1 To 1000 LinePick(0,0,0,1,1,1) Next For n=1 To 1000 vert=Rand(0,CountVertices(sf)) VertexCoords2(sf,vert,Rand(-10,10),Rand(-10,10),Rand(-10,10)) VertexTexCoords2(sf,vert,Rand(-10,10),Rand(-10,10),Rand(-10,10)) Next updatemeshes
The increase in speed presumably happens because LinePick has some overhead when the entities it's concerned with change. An alternate (and marginally faster) optimization would be to perform all your LinePicks before you start moving vertices around.