# Pascal-question: Line between 2 points

This topic is 3994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

http://i10.photobucket.com/albums/a104/dktekno/koord.jpg How do I figure out if a line between these 2 points A and B goes through an object? The object might be a TBevel.

##### Share on other sites
Let F be a function that determines whether two lines intersect.
Let O be an object composed out of n bounding lines L1...Ln.
Let L be your line between A and B.

Test F(L, Li) for all lines L1..Ln. If any of the lines intersect, then L goes through O.

##### Share on other sites
Quote:
 Let F be a function that determines whether two lines intersect.Let O be an object composed out of n bounding lines L1...Ln.Let L be your line between A and B.Test F(L, Li) for all lines L1..Ln. If any of the lines intersect, then L goes through O.

I need an example code.

I don't know how to calculate any line between the two points. I've been thinking of this for several days now, I need a complete fully written example.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 9
• 13
• 9
• 9
• 15
• ### Forum Statistics

• Total Topics
634077
• Total Posts
3015360
×