Question

Find values of A, B, C, and D for the case of a world window (10.0,...

Find values of A, B, C, and D for the case of a world window (10.0, 10.0, -6.0, 6.0) and a viewport (0, 600, 0, 400).

Computer Graphics using OpenGL

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let's first understand world window and view-port.

World window: The region on real world coordinate where selected object to be displayed.

Viewport: The region on device coordinate where graphics of selected object on world window is displayed. Since real world coordinate is different with respect to viewport coordinate coordinate, so one needs proper transformation from world window coordinate to viewport coordinate.

Below is windows and viewport is shown.

world window viewport Yt Ytw pw XN + *

Coordinate convention is (Left, Top, Right,Bottom). In the above figure l stands for left, r for right, t for top and b for bottom. Suffix w for world window and suffix v for viewport.

Lets proceed to transformation:

pw is point in world window. We have to transfom it to pv in the viewport as shown in the figure. let pw=(xw,yw) and pv =(xv,yv). Now transformation is done by two operations scaling and translation. We have to find A,B, C and D. What are these values A, B, C and D? Let's understand.

Transformation is as follows:  

Xv= A*Xw+C...............................(1)

Yv= B*Yw+D................................(2)

A is scaling factor in X direction, B is Scaling factor in Y direction, C is translation factor in X direction and D is Translation factor in Y direction.

Normalized point on Window is as follows:

X W - Xlw YW - Y bw Xrw - Xlwytw - Y bw

Normalized point on viewport is as follows:

Χυ – Xlu Yυ - Yoυ Xry - Xly Ytu - You!

Normalized point is equivalent so

Xw – Xl Xv - XlYw - Ylw Yv - You Xrw - XI – Xry - Xluan rw - Ylwytu - Y bu

Now we can get Xv

  Xrv – Xlu Xv = Xlv +(Xw – Xlw) Xrw - Xw

or, Xru – Xtv Xv = Xlv – Xlw Xrw – Xl Xru – X Xrw - Xw

By comparing with equation (1) we can get

C = Xlv - Xlwr Xrv – Xtv 1)andA=- Xru - Xl Xrw - X Xrw - Xw.................................(3)

Also we can get Yv

Y tv – You Yv=Y bu - Y bw Y tu –Y bu Y tw - You! -) + Ywly - Y bw

By comparing with equation (2) we can get

Y tu – Ybu D = Y bu - Y bw Y tu –Y bu Y twybo andB = y tu - Y bw...................................(4)

in the question all coordinates are given:

World window (Xlw, Ytw, Xrw, Ybw)=(10.0, 10.0, -6.0, 6.0) Viewport  (Xlv, Ytv, Xrv, Ybv)=(0, 600, 0, 400).

From equation 3

   A = Xru - Xlu Xrw - Xlw 0-0 -6 - 10

C = Xlu – Xlw Xru - Xtv -) = Xlv – Xlw * A=0 -0 = 0 Xrw - xlw

From equation 4

200 Ytu –Y bu Ytw - Ybw 600 – 400 10 - 6 = = 50

D=Y bu - Y bw Y tu - Y bu -) = 400 – 6* B = 400 - 6 * 50 = 100 Ytw - Ybw

Thus A=0, B=50, C=0 and D=100.   

Add a comment
Know the answer?
Add Answer to:
Find values of A, B, C, and D for the case of a world window (10.0,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT