CS代考计算机代写 gui Assignment 3 for csci580

Assignment 3 for csci580

Your assignment is to add the transformation process to your HW2 rasterizer. The API calls in rend.cpp *must* be provided just as they are outlined. The Application3 must work without modification, but you should modify the app code to test various rendering conditions.

*** Changes to the API are not allowed ***

The files in hw3.zip include:

Gz.h : A few new definitions for hw3
Application3.cpp, Application3.h: New application that calls your rend.cpp functions
rend.cpp : New skeleton file with API definition and comments
tri.asc : A one-triangle data file for testing
tri.ppm : Running app3 on tri.asc produces tri.ppm (using the default camera)
pot4.asc : The Utah teapot triangle data file, now in its original model coordinates
pot4.ppm : The result using the renderer’s default camera
pot4.cam.ppm : The result with the application setting the camera
CS580HWView.cpp : Link to your application3 and the user interface code.
Other files for the GUI and Windows framework

/* Camera defaults */
#define DEFAULT_FOV 35.0 /* use as both H and V field of view */
#define DEFAULT_IM_Z (-10.0) /* world coords for image plane origin */
#define DEFAULT_IM_Y (5.0)
#define DEFAULT_IM_X (-10.0)
/* default look-at point = 0,0,0 */

The result images are created in a 256×256 window, but you can modify the app3 code to change the size of your FB. The image should magnify or shrink to fit the FB. Again – your background color may be different than mine.

You should “stress-test” your renderer by changing the camera and look at point with the PutCamera call. Don’t forget to clip triangles that are behind the view plane. Try to get an intuition for what happens with different camera parameters.

From now, you can move your object using given user interface. If you click edit button, you can choose three transformation options; Rotate, Translate, and Scale.

If you choose “Rotate Object”, rotation dialog pops up and you can type the value.

If you choose “Translate Object”, translation dialog pops up and you can type the value.

If you choose “Scale Object”, scale dialog pops up and you can type the value.

If you push “Render >> RunRender” button, the transformed object is rendered.

We provide the code for the user interface but you need to provide the function body code that builds the incremental matrices in rend.cpp. Your code should build a transformation based on the parameter that’s specified. Then you set the matrix mat to your result. The interface code takes that matrix and pushes on the matrix stack. Note this incremental matrix is pushed after the application pushes its normal model matrix, so the incremental matrix is right-most in the chair and the last matrix pushed on the stack.

int GzRender::GzRotXMat(float degree, GzMatrix mat)
int GzRender::GzRotYMat(float degree, GzMatrix mat)
int GzRender::GzRotZMat(float degree, GzMatrix mat)
int GzRender::GzTrxMat(GzCoord translate, GzMatrix mat)
int GzRender::GzScaleMat(GzCoord scale, GzMatrix mat)

The callback function, which pops-up a dialog and accumulates transformations for the renderer is in the CS580HWView.cpp. See the followings functions in CS580HWView.cpp for details and to understand the interface.

void CCS580HWView::OnRotate()
void CCS580HWView::OnTranslate()
void CCS580HWView::OnScale()

*** Please do not change the user interface code ***

Submit process is similar to your previous homework. Please read homework guide line carefully. (DO NOT include Debug directory.)