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
Parallel source and Distributed light source a) Parallel source: this is to be noted that while point source is at an infinite distance then light rays are parallel and func

Distinguish between uniform scaling and differential scaling?  When the scaling factors sx and sy are assigned to the similar value, a uniform scaling is produced that maintain

Variation of Intensity - Modeling and Rendering According to the phong model the variation of Intensity (I) along with α (since I α cos n α) is: i) for shiny surface (

TIFF: It is Tagged Image file format which is used mainly for exchanging documents among various applications and computers. This was primarily designed to turn into the standa

Pitfalls in computer simulation Though generally avoided in computer simulations, in strict logic the rules governing floating point arithmetic even apply. For illustration, t

Explain application areas of computer graphics in different areas.    Early computer graphics has only certain special capabilities such as straight lines circles and ellipses


Q. What is the difference between tones and tints? Which one component of YIQ color model does black- and- white television use? How can you convert a ZTSC video signal to an RGB s

Suppose P be the point object along with the coordinate (x,y,z). We want to translate such object point to the new position as, P'(x',y',z') through the translation Vector as V=t x

IFF: It is Amiga Interchange File Format which is used to transfer documents to and from Commodore Amiga Computers. This format is really flexible and permits images and text to b