CMPS-3480 Computer Graphics
Lab-9
Overview:
1. Log into Odin 2. Change to your /3480/9 folder. Copy the lab files now... cp /home/fac/gordon/p/3480/code/9/* . Compile and run the program: make ./lab9 We will write code together. specular reflections specular highlight multiple lights sky animation![]()
![]()
1. Make a new scene that you like 2. Create an animation Your scene should have multiple objects. Your animation must be a looping animation that runs forever and you cannot tell where it starts or ends. The bouncing ball is an example of an animation for this lab.![]()
include file
------------
#include <X11/Xutil.h>
X11_wrapper prototypes
----------------------
void getWindowAttributes(int *width, int *height);
XImage *getImage(int width, int height);
X11_wrapper member functions
----------------------------
void X11_wrapper::getWindowAttributes(int *width, int *height) {
XWindowAttributes gwa;
XGetWindowAttributes(dpy, win, &gwa);
*width = gwa.width;
*height = gwa.height;
}
XImage *X11_wrapper::getImage(int width, int height) {
return XGetImage(dpy, win, 0, 0, width, height, AllPlanes, ZPixmap);
}
Sample of an animation technique
--------------------------------
switch (key) {
case XK_t:
render();
takeScreenshot("", 0);
//move the sphere
obj[1].pos.x += 10.0;
render();
takeScreenshot("", 0);
//make a gif animation
//create your gif animation like in lab6.cpp
break;
Your instructor will find your work out on Odin!