algorithm

HiCan anyone help me in writting an algorithm for a line clipping algorithm that uses a triangular clipping region?
[129 byte] By [ayaha] at [2007-10-1 0:13:47]
# 1

It should be the same as most polygonal clipping algorithms.

Test if endpoints of the line are inside the polygon. If both are (and since your polygon is convex), no change. If one is, find the intersection and clip. If both are out, test if there are any intersections, and if so, use the intersections points to clip the line.

jboeinga at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 2
ok but how the test will become can you explain?
ayaha at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 3
> ok > but how the test will become can you explain?Can you google?
Adeodatusa at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 4
How that?
ayaha at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 5
> How that?Aye Arghh!
sabre150a at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 6
If you're serious, and I hope you're not. If you're serious...You "google" by going to a search engine named "google" (www.google.com), typeing in your search, and hitting the "search" button.
Adeodatusa at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 7
Oh my God Can this occur ?!!
ayaha at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 8
> Oh my God > Can this occur ?!!What?
sabre150a at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 9
What is the algorithm for triangular clip ?
ayaha at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 10
> What is the algorithm for triangular clip ?This is where you came in! It is starting to sound like the three stooges!
sabre150a at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 11
> > What is the algorithm for triangular clip ?> > This is where you came in! It is starting to sound> like the three stooges!No no, this is a Laurel and Hardy routine. Total classic.
RadcliffePikea at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 12

Oh, I've got a good answer to the question.

> What is the algorithm for triangular clip ?

It should be the same as most polygonal clipping algorithms.

Test if endpoints of the line are inside the polygon. If both are (and since your polygon is convex), no change. If one is, find the intersection and clip. If both are out, test if there are any intersections, and if so, use the intersections points to clip the line.

Adeodatusa at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 13
Sorry, forgot the obligatory smirk.;~)
Adeodatusa at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...
# 14
okbut how the test will become can you explain?
sabre150a at 2007-7-7 15:58:05 > top of Java-index,Other Topics,Algorithms...