PDA

View Full Version : Clipping rectangle



30baz
11-17-2008, 07:15 PM
guys i really need some to help me solve this problem i need the code urgently :) thnks aloy
----------------------------------------------------------------------
Implement a program that lets the user type in a file name that contains
information about a clipping rectangle (with edges parallel to the x- and y-axes)
and some line segments. Your program should determine the sum of the line
lengths inside the clipping rectangle. You must draw all line segments before and
after clipping along with the clipping rectangle.
Below is a sample file.
2 2 5 5
3 1 6 4
3 3 4 4
1 5 3 6
3 1 2 6

The first row contains the coordinates of two corners of the clipping rectangle.
The subsequent rows contain the start and end points of different line segments.

trinitrotoluene
11-17-2008, 09:33 PM
Look at this algorithm (http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/). Thats all you need :) .

30baz
11-18-2008, 05:26 PM
mate .. wassup buddy .. thnk fo ut time at first i still dont get what clipping is and its all [censored] in my head and i have this question as an assignment and i have to submit it tommorow so if u can solve it for me i would be grateful .. and im really sorry for being a burden on u .. but im still a beginner and need the help :)
thnks again




Best Regards,
30baz

ZbuffeR
11-19-2008, 01:40 AM
ha ha ha

IneQuation.pl
11-19-2008, 07:23 AM
Dude, if you don't undestand the basics and just want to get someone else write the code for you, it means you really shouldn't study computer science. Find a different field.

_NK47
11-19-2008, 09:54 AM
good luck. tell us how it was