Tuesday, June 9, 2009

Tips Answers for CA

I know its late!! Tried to answer as best i can.
Didnt answer 2c and only give the formula for 5
If u see any mistakes, plz inform me.

1. RGB-

Magenta = (1,0,1)

(R,G,B)

CMY-

Magenta = (RGB white)-(RGB magenta) = (1,1,1) – (1,0,1) = (0,1,0)

2.

a. Vector A->C = C-A= (4,1,2) – (3,3,2) = (1,-2,0)

Vector A->B = B-A= (2,2,1) – (3,3,2) = (-1,-1,-1)

Vector B->C = C-B= (4,1,2) – (2,2,1) = (2,-1,1)

b. Dot product A->B . B->C = (-1,-1,-1) . (2,-1,1) = (1st * 1st)+ (2nd *2nd)+(3rd * 3rd)

=(-1*2)+(-1*-1)+(-1*1)=-2

3. First Object

glBegin (GL_LINE_LOOP);

glvertex2i (200,60);

glvertex2i (240,150);

glvertex2i (280,60);

glvertex2i (190,120);

glvertex2i (290,120);

glEnd();

Second Object

glBegin (GL_LINE_STRIP);

glvertex2i (200,60);

glvertex2i (280,60);

glvertex2i (240,150);

glEnd();

glBegin (GL_LINE_STRIP);

glvertex2i (290,120);

glvertex2i (190,120);

glvertex2i (240,30);

glEnd();

4. Transform Rotate Scale

|1 0 tx| |cos& -sin& 0 | |sx 0 0 |

|0 1 ty| | sin& cos& 0 | |0 sy 0 |

|0 0 1 | | 0 0 1 | |0 0 1 |

The matrixes must be written from right to left. Instead of [S] [R] [T], the order of the question.

We have [T][R][S] (Remember This!!)

Transform Rotate Scale

|1 0 2 | | 0 -1 0 | |3 0 0 |

|0 1 2 | | 1 0 0 | |0 4 0 |

|0 0 1 | | 0 0 1 | |0 0 1 |

Then add them one by one.

[T]+[R]

[T] 1st row by [R] 1st column = (1*0)+(0*1)+(2*0)=0

[T] 1st row by [R] 2nd column = (1*-1)+(0*0)+(2*0)=-1

[T] 1st row by [R] 3rd column = (1*0)+(0*0)+(2*1)=2

[T] 2nd row by [R] 1st column = (0*0)+(1*0)+(2*1)=2

[T] 2nd row by [R] 2nd column = (0*-1)+(1*0)+(2*0)=0

[T] 2nd row by [R] 3rd column = (0*0)+(1*0)+(2*1)=2

[T] 3rd row by [R] 1st column = (0*0)+(0*0)+(1*1)=1

[T] 3rd row by [R] 2nd column = (0*-1)+(0*0)+(1*0)=0

[T] 3rd row by [R] 3rd column = (0*0)+(0*0)+(1*1)=1

So[TR] =|0 -1 2|

|2 0 2|

|1 0 2|

Then repeat the steps for [TR] + [S]

5. Xb = mi=0 mCi ui (i-u)m-I X

Yb = mi=0 mCi ui (i-u)m-I Y

m= number of point given -1

C= Combination (We did this B4)


No comments:

Post a Comment