CS2405 - COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,

  • Published on
    21-Jan-2016

  • View
    215

  • Download
    0

Transcript

<ul><li><p>CS2405 - COMPUTER GRAPHICS LABORATORY</p></li><li><p>LIST OF EXPERIMENTSImplementation of Bresenhams Algorithm Line, Circle, Ellipse.Implementation of Line, Circle and Ellipse AttributesTwo Dimensional transformations - Translation, Rotation, Scaling, Reflection, Shear.Composite 2D TransformationsCohen Sutherland 2D line clipping and WindowingSutherland Hodgeman Polygon clipping AlgorithmThree dimensional transformations - Translation, Rotation, ScalingComposite 3D transformationsDrawing three dimensional objects and ScenesGenerating Fractal images</p></li><li><p>List of Equipments and Components Software : 1) Turbo C 2) Visual C++ with OPENGL 3) Any 3D animation software like 3DSMAX, Maya, Blender</p><p>2. Operating system : WINDOWS 2000 / XP </p></li><li><p>Bresenhams Algorithm Line, Circle &amp; EllipseThe Bresenham's line-drawing algorithm is based on drawing an approximation of the true line. The true line is indicated in bright color, and its approximation is indicated in black pixels. In this example the starting point of the line is (0, 0) and the ending point of the line at (9, 6).</p></li><li><p>Line, Circle and Ellipse AttributesAny parameter that affects the way a primitive is to be displayed is referred to as an attribute parameter.</p><p>Line attributesCircle attributesEllipse attributes</p></li><li><p>2D TransformationsTransformaions are a fundamental part of computer graphics. Transformations are used to position objects, to shape objects, to change viewing positions, and even to change how something is viewed (e.g. the type of perspective that is used).TranslationAssume you are given a point at (x,y)=(2,1). Where will the point be if you move it 3 units to the right and 1 unit up? Ans: (x',y') = (5,2). How was this obtained? - (x',y') = (x+3,y+1). That is, to move a point by some amountdxto the right anddy up, you must adddxto the x-coordinate and adddyto the y-coordinate.What was the required transformation to move the green triangle to the red triangle? Here the green triangle is represented by 3 points triangle = { p1=(1,0), p2=(2,0), p3=(1.5,2) }</p></li><li><p> Scaling Suppose we want to double the size of a 2-D object. That is, we must specify how much to change the size along each dimension. Below we see a triangle and a house that have been doubled inbothwidth and height (note, the area is more than doubled).RotationBelow, we see objects that have been rotate by 25 degrees.</p></li><li><p>A sequence of transformations calculate composite transformation matrix rather than applying individual transformations</p><p> Composite two-dimensional translations Apply two successive translations, T1 and T2</p><p>Composite transformation matrix in coordinate form</p><p>Composite transformation</p></li><li><p>2D Clipping &amp; windowingClipping Techniques in 2D Clipping in Two dimensionsLook at some possible cases.Unclipped image</p><p>Clipped image</p></li><li><p>Window to Viewport MappingStart with 3D scene, but eventually project to 2D scene2D scene is infinite plane. Device has a finite visible rectangle.Answer: map rectangular region of 2D device scene to device.Window:rectangular region of interest in scene.Viewport:rectangular region on device.Usually, both rectangles are aligned with the coordinate axes.</p></li><li><p>The Sutherland - Hodgman algorithm performs a clipping of a polygon against each window edge in turn. It accepts an ordered sequence of verices v1, v2, v3, ..., vn and puts out a set of vertices defining the clipped polygon.</p><p>This figure represents a polygon (the large, solid, upward pointing arrow) before clipping has occurred.The following figures show how this algorithm works at each edge, clipping the polygon.Clipping against the left side of the clip window.Clipping against the top side of the clip window.Clipping against the right side of the clip window.Clipping against the bottom side of the clip window.Sutherland - Hodgman Polygon Clipping</p></li><li><p>3-D TransformationsTransformations allow the developer to reposition, resize, and reorient models without changing the base values that define them.TranslationIt moves all the points in the Model3D in the direction of the offset vector with theOffsetX,OffsetY, andOffsetZproperties. For example, one vertex (2,2,2), an offset vector of (0,1.6,1) would move that vertex (2,2,2) to (2,3.6,3). The cube's vertex is still (2,2,2) in model space, but now that model space has changedits relationship to world space so that (2,2,2) in model space is (2,3.6,3) in world space.</p></li><li><p>ScalingIt changes the model's scale by a specified scale vector with reference to a center point. Specify a uniform scale, which scales the model by the same value in the X, Y, and Z axes, to change the model's size proportionally. For example, setting the transform'sScaleX,ScaleY, andScaleZproperties to 0.5 halves the size of the model; setting the same properties to 2 doubles its scale in all three axes.</p></li><li><p>RotationAxis-angle rotations assume rotation about the origin if a value is not specified for theCenterX,CenterY, andCenterZproperties on RotateTransform3D. As with scaling, it's helpful to remember that the rotation transforms the model's entire coordinate space. If the model was not created about the origin, or has been translated previously, the rotation might "pivot" about the origin instead of rotating in place.</p></li><li><p>Drawing three dimensional objects and Scenes</p></li><li><p>Animationis the rapid display of a sequence of images to create anillusionof movement. The most common method of presenting animation is as a motion picture or video program.</p><p>The bouncing ball animation consists of these six frames(Flash). This animation moves at 10 frames per second.</p></li><li><p>Generating Fractal imagesSelf similarity between parts and overall features of the object is called fractal.</p></li><li><p>*</p></li></ul>

Recommended

View more >