Page 166 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 166
Lab on Computer Graphics
Notes scanf(“%f”,&Angle);
cleardevice();
Angle=(Angle*3.14)/180;
a1=p+(x1 – p)*cos(Angle) – (y1 – q)*sin(Angle);
b1=q+(x1 – p)*sin(Angle)+(y1 – q)*cos(Angle);
a2=p+(x2 – p)*cos(Angle) – (y2 – q)*sin(Angle);
b2=q+(x2 – p)*sin(Angle)+(y2 – q)*cos(Angle);
Self Assessment Questions
1. Shearing transformations in two-dimensions alter two of the three coordinate values
proportionally to the value of the third coordinate.
( a) True (b) False
2. Given a frame we ………………………. a frame by transforming the third vector by adding
a linear combination of the other two vectors.
( a) (x,y,z)-shear (b) x-shear
( c) y-shear (d) z-shear
3. Shearing related to x axis: Transform coordinates …………………………and y1=y.
( a) x1=shx*y (b) x1=x+shx*y
( c) x1=x+shx*x (d) None of these
4. Rotations around the x, y and z axes are called…………………...
( a) axis of rotation (b) center of rotation
( c) origin of rotation (d) principal rotations
5. X axis shear related to the reference line y–y ref is x1=x+shy(y – y ref) and y1=y.
( a) True (b) False
10.3 Reflection
Reflection in computer graphics is used to track reflective objects alike to mirrors and shiny
surfaces. Reflection is achieved in a ray draw renderer by subsequent a ray from the eye to the
mirror and then calculating where it bounces from, and continuing the process awaiting no
surface is found, or a non-reflective surface is found. Reflection on a shiny surface like wood
or tile can add to the photorealistic effects of a 3D rendering.
Polished: A Polished Reflection is an undisturbed reflection, like a mirror or chrome.
Blurry: A Blurry Reflection means that tiny random bumps on the surface of the material cause
the reflection to be blurry.
Metallic: A reflection is metallic if the highlights and reflections retain the colour of the reflective
object.
Glossy: This term can be misused. Sometimes it is a setting which is the opposite of Blurry.
(When “Glossiness” has a low value, the reflection is blurry.) However, some people use the
term “Glossy Reflection” as a synonym for “Blurred Reflection.” Glossy used in this context
means that the reflection is actually blurred.
160 LOVELY PROFESSIONAL UNIVERSITY