Polygon clipping algorithm, Computer Graphics

Write a polygon clipping algorithm to clip a polygon against rectangular clipping are.

Read the vertices of polygon to be clipped. 2. Read the coordinates of the rectangular clipping area against which it has to be clipped. 3. Considering the edge of rectangular area one at a time we apply the following algorithm. 4. /* p is the input vertex, vertex under consideration S is the previous vertex. F is the first point. E is the edge under consideration (of rectangular 7 area against which it has to be clipped) */ Input vertex P 5. If P is the point store it in a variable say F and proceed to step 7. 6. If P is not the first point then if edge 5t intersect edge E under consideration. Computer the intersection point 1 Output vertex 1 else proceed to step 7. 7. Store P in variable S (S=P) 8. If S is on left side of edge E output vertex S. 9. Repeat steps 4 to 8 till all the vertices are processed 10. /* for closing polygon */ if 3f intersect E Computer intersection point 1 output vertex 1 11. Repeat the above steps (4 to 10) with new output polygon obtained from step 10 for other edges of rectangular area under consideration. 

 

Posted Date: 7/1/2012 6:43:52 AM | Location : United States







Related Discussions:- Polygon clipping algorithm, Assignment Help, Ask Question on Polygon clipping algorithm, Get Answer, Expert's Help, Polygon clipping algorithm Discussions

Write discussion on Polygon clipping algorithm
Your posts are moderated
Related Questions
Introduction To Computer Graphics Early man employed drawings to communicate even before he learnt to communicate, write or count. Incidentally, these earliest hierogly


Amiga - Hardware for computer animation Originally owned through Commodore, Amiga computers have conduct a position in the computer animation industry for many years. This is

1. What do you understood by the term graphic primitives? Ans. Graphic primitives are the basic graphic objects that can be united in any number and method to produce a new i


The RIA should consist of: i) A simple Graphical User Interface (GUI) constructed from a simple navigation system (comprising of around 5 key frames) making use of the Flash tim

What is orthographic parallel projection?  When the direction of the projection is normal (perpendicular) to the view plane then the projection is called as orthographic paral

Web Design and Editing To edit and make a website, the big three softwares are use: 1)   DreamWeaver (MacroMedia) 2)   Frontpage (MicroSoft) 3)   Go Live (Adobe) 4)

DDA or Digital Differential Analyzer Algorithm - Line generation algorithms From the above discussion we get that a Line drawing is accomplished through calculating intermedi

Achieve a perspective projection on the z = 0 plane of the unit cube, demonstrated in Figure (l) from the cop at E (0, 0, 10) upon the z-axis. Figure: I 01:  currently c