0
$\begingroup$

I'm attempting to basically create a road within a game, and am struggling with how I can detect if my existing geometry is in fact on this road.

Basically I have a list of x,y,z coordinates and if I draw a straight line between all of them that's the path I want to follow (assume an arbitrary width).

The problem is I have a list of normals/vertices/indices and don't know how to "detect" what is within the bounds of my road and what isn't.

Anyone have any ideas on how I can basically right a function that says:

IsPointOnRoad(float[3] point)

Anyone have any ideas on how to do this? I'm WAY rusty on my math, sadly, and have been trying to think this through.

Thanks in advance!

  • 1
    Do you mean a single straight line through all of your points, or a sequence of straight line segments from one point to another?2012-11-05
  • 0
    Take a look at http://math.stackexchange.com/questions/190111/how-to-check-if-a-point-is-inside-a-rectangle .2012-11-05

1 Answers 1