Computing Science CMPT 361
Instructor: Richard (Hao) Zhang
Summer 2012
Simon Fraser University
Assignment #1 Solution
Problem 2 (2 marks): Why HD DVD failed?
The so-called true high definition video mode, 1080p, supports a screen resolution of
1920 1080.
Cmpt 371
Assignment #1 Solutions
May 23, 2012
1. [P6] Given two hosts, A and B, connected by a single link of length m meters with transmission rate R bps and propagation speed s meters/sec. Host A will send packets of size L bits
to Host B.
(a) Propagati
Computing Science CMPT 361
Instructor: Richard (Hao) Zhang
Summer 2012
Simon Fraser University
Assignment #1 (30 marks)
Written part due: Tuesday, June 14, in class.
Programming part due: Tuesday, June 14, at 11:45 p.m.
On the cover page of your homework,
Cmpt 371
Assignment #1
May 14, 2012
Due Wednesday May 23rd by 16:00 in the black course assignment box located in the CSIL.
Be sure you place your solution in the box assigned to Cmpt 371.
From the problems at the end of Chapter 1 in the text:
1. P6
2.
(a
Programming using OpenGL
3.1: A First Introduction
Richard (Hao) Zhang
(first 60 slides adopted from Torsten Mller)
Introduction to Computer Graphics
CMPT 361 Lecture 3
May 17, 2012
1
Today
OpenGL API overview and modern architecture
OpenGL
OpenGL librari
Cmpt 371
Assignment #3 Solutions
June 16, 2012
From the problems at the end of Chapter 2 in the text:
1. [P24] This question asks you to specify distribution schemes that will work in a P2P architecture. The challenge here is to see how we can use the ban
#include "sphere.h"
#include <stdlib.h>
#include <math.h>
/*
* This function intersects a ray with a given sphere 'sph'. You should
* use the parametric representation of a line and do the intersection.
* The function should return the parameter value for
3. Input and Interaction
1
Paradigm for interactive CG
The Sketchpad project by Ivan Sutherland in 1963
Basic interactive paradigm (used for CAD in
Sketchpad):
User sees an image on the display
User interacts with the image through an input device (li
7. Rasterization
1
Where are we at now?
Scan conversion of polygons
2
Overview
Rasterizer: generate pixels
Generate pixels covered by geometry primitives.
Flood Fill
3
Drawing Points
3DGeometricPrimitives
Modelview
Transformation
Viewing(projection)
Tr
2. OpenGL Basics
1
About OpenGL
Do not:
Deify OpenGL
Think you dont need to know underlying fundamentals
Think we will only do OpenGL
Remember: 10 years from now OpenGL may be history
2
Rendering
Turning everything into pictures
3D Geometric
Models
6. Clipping
1
Where are we at now?
Clipping
2
Clipping
Why do clipping at all?
In practice, eye or camera both have field of vision
Clipping removes portion of a scene (the primitives)
outside of the field of vision or contributes little to the
scene l
4. Transformation
1
Definition
Transformation
Mathematical operation that moves or changes the shape of
an object
Were most interested in:
Translation (moving)
Rotation (spinning)
Scaling (changing size)
2
OpenGL code
glTranslated(x, y, z)
whatever
5. Viewing
1
3D Viewing
We need to:
2
chooses a projection type (not necessarily perspective)
setup the camera
clips the scene according to the setting
project the scene onto the computer display
The ideal pinhole camera
A single ray of light gets throu
13. Radiosity
1
Rasterization-based rendering
What can we do with rasterization-based rendering
and ray tracing
What we cant do
2
Rasterization-based rendering
Types of reflections
Diffuse reflection of light sources
Specular reflection of light sour
/*
* CMPT 361, Summer 2012
*
* raycast.cpp
*
* Render a simple scene using ray tracing
*
* NAME:
* SFU ID:
*
* Template code for drawing a scene using raycasting.
* Some portions of the code was originally written by
* M. vandePanne - and then modified by
/*
* Some stuff to handle spheres
*/
#include "vector.h"
typedef struct sphere cfw_
int index; / identifies a sphere; must be greater than 0
Point center;
float radius;
float mat_ambient[3]; / material property used in Phong model
float mat_diffuse
/
/ this provide functions to set up the scene
/
#include "sphere.h"
#include <stdio.h>
extern
extern
extern
extern
Point
float
float
float
light1;
light1_ambient[3];
light1_diffuse[3];
light1_specular[3];
extern float global_ambient[3];
extern Spheres *s
#include
#include
#include
#include
<stdio.h>
<GL/glut.h>
<string.h>
"global.h"
/ Global variables
extern int win_width;
extern int win_height;
extern GLfloat frame[WIN_HEIGHT][WIN_WIDTH][3];
/*
* This function saves the current image to a ppm file
*
* DO
15. Image Basics
1
Overview
Image Representation
Image sampling
Sampling artifacts
Pixel Operations
Brightness
Contrast
Saturation
Filters
1D convolution
2D convolution
Histograms
2
What is a digital image?
It is a rectangular array of pixels
17. HighDynamicRangeImaging
1
The Dynamic Range Problem
The real world brightness has high dynamic range
We need 5-10 million values to record brightness of the real world
10-3
1.5
2.5x104
4x105
2x106
2
The Dynamic Range Problem
The real world brightne
SFU CMPT 361
Computer Graphics
Fall 2016
Assignment 3
Assignment due Tuesday, December 6, by 11:59 pm.
For this assignment, you are to write a program that interprets an input 3D graphics specification and renders it, using a basic
shading model and a z-b
SFU CMPT 361
Computer Graphics
Fall 2016
Assignment 2
Assignment due Friday, November 4, by 11:59 pm.
For this assignment, you are to interpret a 3D graphics specification
implement three line drawers and a polygon drawer.
These rendering components shoul
SFU CMPT 361
Computer Graphics
Spring 2017
Assignment 2
Assignment due Thursday, February 23, 11:59pm
For this assignment, you are to interpret a 3D graphics specification language, along with doing some preparatory work. The
preparatory work is (1) to in
SFU CMPT 361
Computer Graphics
Spring 2017
Assignment 3
Assignment due Thursday, March 16, by 11:59 pm.
For this assignment, you are to expand your renderer from assignment 2 with perspective, ambient lighting, and obj file
reading.
The required display i
SFU CMPT 361
Computer Graphics
Spring 2017
Assignment 4
Assignment due Thursday, April 6, by 11:59 pm.
For this assignment, you are to expand your renderer from assignment 3 with point light sources and phong-model lighting
calculations.
The required disp