联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp2

您当前位置:首页 >> Web作业Web作业

日期:2018-10-22 09:59

CS425 Computer Graphics I

Lab 2: Matrix Transformations, Clipping, and the Viewing Volume

due on Tuesday, October 30, 2018 at 11:59 PM

Objectives:

Apply matrix transformations to points and lines as shear, scale, translate, and rotate

functions

Render perspective projections of 3D scenes using the canonical viewing volume

Use clipping algorithms to constrain your image to a view window

Tasks:

In this project, you will be depicting a room from the perspective of a toy drone coming in to the

room. You must implement a perspective transformation with matrices and clipping algorithms

to render your scene. You may use GL_LINES, GL_LINE_LOOP, and GL_LINE_STRIP to

draw the outlines of your shapes, but you may not use OpenGL’s built-in glFrustum,

gluPerspective, and other functions that automatically handle perspective transformations or clip

the scene. You do not have to fill polygons; this is a wireframe rendering of your database.

Parameters:

(A) You will need to construct your own database of objects in 3-dimensional space. Your

scene must include the following objects, which should be reasonably sized and

positioned so I can clearly see them:

A corridor with a dashed center line

A door with a number at the top of the door

A box with levitating cylinder

Two lamp shades one on either side of the corridor [NOT required for undergraduates]

A backwall at a long distance with wall mounting/painting in the background (you may

use simple 2D triangular shapes for the paintings)

(B) Requirements for your viewing volume:

VUP( View Up Vector) is (0,1,0)

The PRP* (Projection Reference Point), center of the view window, and midpoint of the

horizon line should lie on the same line, i.e. camera of your drone will always be “looking at”

the middle of the backwall.

Note: Projection Reference Point (PRP) defines the Center of Projection and Direction of

Projection (DOP).

The distance between the PRP, Front plane, Back plane, and Viewing plane can be constant.

However, you should choose your distances so that,

o The viewing volume is large enough to see a reasonable amount of your scene

o The viewing volume is small enough that some of your scene is clipped by the

front/back planes

See the last page for an example room design and a link to a demo.

Flying the “DRONE”

Both undergraduate and graduate students’ renderings will be dynamically changing the position

and orientation of the canonical viewing volume. Specifically, you will change the PRP and

apply the rules of section (B) to find your new view coordinates.

Apply matrix transformations to points and lines as shear, scale, translate, and rotate functions

Render perspective projections of 3D scenes using the canonical viewing volume

Use clipping algorithms to constrain your image to a view window

For Undergraduate Students:

You will use following keyboard commands to control the position of the PRP (and update the

viewing volume accordingly):

W: increase the Y value of the PRP (fly up)

S: decrease the Y value of the PRP (fly down)

A: decrease the X value of the PRP (move left)

D: increase the X value of the PRP (move right)

F: decrease the Z value of the PRP (zoom in)

V: increase the Z value of the PRP (zoom out)

Please choose increment values that allow a user to traverse the scene fairly quickly.

For graduate students:

You will “land” your drone (or keep it on a reasonable elevation such that you see the objects in

the room) by continuously updating the position of the PRP along a pseudo-animated trajectory.

The trajectory of your drone would look something like this, from the side:

The drone descends and moves forward until it reaches the “ground,” after which it moves

forward without changing altitude.

You should also support the following keyboard commands:

A: decrease the X value of the PRP (move left)

D: increase the X value of the PRP (move right)

R: reset the PRP to its original position and restart the “animation” from the beginning

Lastly, the levitating object in the box in your room should rotate in place continuously.

Submission:

Your code should run on either a Windows/Mac or Linux operating system. Submit your source

code and any header files in a single zipped folder to Blackboard. Please name the folder

425_Lab2_<your name>.

Also, submit 2-3 numbered screenshots of the working project with the description of the

screenshot_yourname.png

Grading and Late Policy:

This project is worth 5% of your total grade. Non-submitted or non-functional labs without

substantial work will result in a -5% penalty to your total grade. It must be simple to run your

code in order for you to receive ANY points.

Late submissions receive -50% for every 24 hours that the submission is late, for up to 2 days.

Labs will not be accepted more than 2 days (48 hours) after the due date.

Your code MUST be your own work. Cheating is not acceptable and will be reported to the

professor. MOSS will be used to check code.

Lab 2 breakdown:

10% Program compiles and runs without me having to look at your code

35% Scene renders correctly for the initial PRP value

- 5% Correct VPN, VRC, etc

- 10% Clipping

- 4% for each object placed in the scene as specified in section (A) (x 5)

- 2% Object has all necessary components

- 2% Application of matrix transformations

35% Scene renders correctly for subsequent changes to the viewing volume (same breakdown)

10% Correct implementation of key commands (undergrad) or key commands + animation

(grad)

10% Programming style (comments, etc)

An online demo is provided at https://www.youtube.com/watch?v=JUFYd4_--

Qk&feature=youtu.be

A quick primer of the Viewpoint projections and specifications can be found at -

https://www.cs.uic.edu/~jbell/CourseNotes/ComputerGraphics/Projections_Viewpoints.html

Sample Code

You are given a sample starter code. It is only given so that you understand how you could

structure your application. However, the sample uses glOrtho code which you should not use in

your final submission. Please pay attention to the comments in the code.


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp