You are on page 1of 7

Pankaj Tambe (Computer Graphics Project

)

DESIGN OF A PAPER WEIGHT
Abstract: In this project, a paper weight which is octagonal in shape with a sphere inside exactly at the centre. Octagonal solid become transperent whereas sphere is opaque. In this project, emphasis is on tranperency, colouring and lighting of an object.

Introduction:
Computer graphics is a diversified technology. The end product of a computer graphics is a picture. The picture may, of course, be used for a large variety of purposes; e.g,. it may be an engineering drawing, a business graph, design project, an advertise illustration. Computer graphics are any types of images created using any kind of computer. There is a vast amount of types of images a computer can create. Also, there are just as many ways of creating those images. Images created by computers can be very simple, such as lines and circles, or extremly complex such as fractals and complicated rendered animations.

Model description:
The paper weight is octagonal in shape with a sphere inside exactly at the centre. Octagonal solid become transperent whereas sphere is opaque.

Design:
First of all the wire frame model of a octagonal solid is made, then each face is filled with a patch of requisite face and edge color. To make the object transparent alpha command is used, for that first focous the light on the object, then trough alpha command refraction of light takes place so that the object look transparent. Sphere is drawn separately and is exactly located at the centre of the octagon solid.

Command description:
Transperency: Making graphics objects semi-transparent is a useful technique in 3-D visualization to make it possible to see an object, while at the same time, see what information the object would obscure if it was completely opaque.

Not at all objects are opaque; some transmit light, e.g., glasses,vases, automobiles windows, water, etc. transmit lidht and are transparent.

1

Pankaj Tambe (Computer Graphics Project) The transparency of a graphics object determines the degree to which you can see through the object. You can specify a continuous range of transparency varying from completely transparent (i.e., invisible) to completely opaque (i.e., no transparency). Objects that support transparency are: 1) Image 2) Patch 3) Surface Transparency values, which range from [0 1], are referred to as alpha values. An alpha value of 0 means completely transparent (i.e., invisible); an alpha value of 1 means completely opaque (i.e., no transparency).

Fig: Object shows the trancperency Surface: Surf(X,Y,Z,C) creates a shaded surface, with color defined by C. MATLAB performs a linear transformation on this data to obtain colors from the current colormap.

2

Pankaj Tambe (Computer Graphics Project)

Fig: Surface

Shading interp: shading interp varies the color in each line segment and face by interpolating the colormap index or true color value across the line or face.

Patch: Using the vertices/faces technique can save a considerable amount of computer memory when patches contain a large number of faces. This technique requires the formal patch function syntax, which entails assigning values to the 3

Pankaj Tambe (Computer Graphics Project) Vertices and Faces properties explicitly. For example, patch('Vertices',vertex_matrix,'Faces',faces_matrix)

Fig: Cube drawn by using Patch

Colorspec: ColorSpec is not a command; it refers to the three ways in which you specify color in MATLAB: 1)RGB triple 2)Short name 3)Long name The short names and long names are MATLAB strings that specify one of eight predefined colors. The RGB triple is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color; the intensities must be in the range [0 1]. Daspect: Daspect([aspect_ratio]) sets the data aspect ratio in the current axes to the specified value. Specify the aspect ratioas three relative values representing the ratio of the x-, y-, and z-axis scaling (e.g., [1 1 3] means one unit in x is equal in length to one unit in y and three unit in z). Axis tight: Axis tight sets the axis limits to the range of the data. 4

Pankaj Tambe (Computer Graphics Project)

Grid on: Grid on adds major grid lines to the current axes. Camlight: 1) Camlight ('headlight') creates a light at the camera position. 2) Camlight ('right') creates a light right and up from camera. 3) Camlight ('left') creates a light left and up from camera. 4) Camlight with no arguments is the same as camlight('right'). Lighting: Lighting selects the algorithm used to calculate the effects of light objects on all surface and patch objects in the current axes. 1) lighting flat selects flat lighting. 2) lighting gouraund selects gouraud lighting. 3) lighting phong selects phong lighting. Texture mapping:

When you use the imshow command, MATLAB displays the image in a two-dimensional view. However, it is also possible to map an image onto a parametric surface, such as a sphere, or below a surface plot. The warp function creates these displays by texture mapping the image. Texture mapping is a process that maps an image onto a surface grid using

5

Pankaj Tambe (Computer Graphics Project) interpolation.

Result:

6

Pankaj Tambe (Computer Graphics Project)

Conclusion:
The paper weight has been successfully drawn with requsite features, having octagonal surface transparent and opaque sphere with colormap of hsv(1) i.e, red, hsv(1000) and texture mapped as shown in the result.

Future work:
In this object to intend more reality, further step is to use opengl graphics system.

7