Anda di halaman 1dari 2

Royal University of Phnom Penh CG II: Lab 4

Faculty of Engineering Lecturer: Kor Sokchea

Lab 4: MouseMotion & Math

Required Tasks:
Write a mouse controlled animation (activate the display mode GLUT_DOUBLE and work
with glutSwapBuffers(); at the end of your 3D display function).
Use different 3D objects from the libraries, e.g. gluSphere(GLUquadric* quad, GLdouble
radius, GLint slices, GLint stacks); and/or glutWireTorus(GLdouble innerRadius,
GLdouble outerRadius, GLint nsides, GLint rings);
Rotate the scene around an axis with glRotated(GLdouble angle, GLdouble x, GLdouble y,
GLdouble z).
Integrate glutMouseFunc(void(*func)(int button, int state, int x, int y)); such that your
scene rotates around the respective axis while pressing and moving the mouse pointer
on the screen. The animation stops when the button is released.
Add a rotation around two other space axes attached to the remaining mouse buttons.

Note: Math problem please do it in word and convert to PDF. Create one folder and put
everything there and zip it. Please be careful, I accept only submission in Moodle only. No
more through email!!!!!!!!

Math Problems
1. We want to project of the prism with vertices , , , , , onto plane =0 in the
direction parallel to the z-axis. The viewpoint in homogeneous is V(0, 0, 1, 0) and the
viewplane has the equation = + + + = . The prism vertices is as follows

, , , , , , , , , , , , , , , (, , )

Demonstrate and find the projected vertices of prism by using the formula on the 3D
viewing slide.
Royal University of Phnom Penh CG II: Lab 4
Faculty of Engineering Lecturer: Kor Sokchea

2. We want to project of the prism with vertices , , , , , onto plane =0 from the
viewpoint V(1, 5, 3). The viewpoint in homogeneous is V(1, 5, 3, 1) and the viewplane has
the equation = + + + = . The prism vertices is as follows

, , , , , , , , , , , , , , , (, , )

Demonstrate and find the projected vertices of prism by using the formula on the 3D viewing
slide.
Deadline: 12th Nov 2017 until 23: 55

Anda mungkin juga menyukai