Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|cite|improve this question
Do you mean a single straight line through all of your points, or a sequence of straight line segments from one point to another? – Matthew Conroy Nov 5 '12 at 1:36
Take a look at… . – Matthew Conroy Nov 5 '12 at 1:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.