Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
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? –  Matthew Conroy Nov 5 '12 at 1:36
    
Take a look at math.stackexchange.com/questions/190111/… . –  Matthew Conroy Nov 5 '12 at 1:40
add comment

1 Answer

Your Answer

 
discard

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.