Program Assignment 4

Program Assignment 4 - CS480 / CS680 Program Assignment 4 -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS480 / CS680 Program Assignment 4 -- 2004 http://www.cs.bu.edu/fac/sclaroff/courses/cs480/p4/ 1 of 6 4/7/2008 12:55 AM Programming Assignment 4: Ray Tracing Due Monday April 28 at 11:59pm Write a ray tracer that implements at least the following capabilities: ray tracing of quadric surfaces of the form x T Qx = 0 spheres ellipsoids cylinders (with two planar end-caps) boxes (formed by 6 planes) support for up to 5 RGB color light sources: point light sources (with radial attenuation) spot light sources (wiht angular attenuation) infinite light sources ambient light sources RGB color lighting model that includes: ambient, diffuse and specular terms shadows reflections The corresponding lighting model equations in the textbook are: (10-2) radial attenuation (10-5) angular attenuation (10-9) for diffuse reflection (10-13) for specular reflection (10-19) for combined lighting Quadric Surfaces In this assignment, your ray tracer will only need to support quadric surfaces of the form: F(x,y,z) = Ax 2 + 2Bxy + 2Cxz + 2Dx + Ey 2 + 2Fyz + 2Gy + Hz 2 + 2Iz + J = 0 This general equation can be written in matrix notation as x T Qx = 0, where Q is the 4x4 matrix: Q = | A B C D | | B E F G | | C F H I | | D G I J | and x T = [x y z 1]. To intersect a ray x = p + t u with the quadric surface, we simply substitute x into the matrix equation above. Expanding out we get 0 = x T Qx = (p + t u) T Q(p + t u) = (u T Qu )t 2 + (2u T Qp) t + (p T Qp ) which is a quadratic equation in t .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS480 / CS680 Program Assignment 4 -- 2004 http://www.cs.bu.edu/fac/sclaroff/courses/cs480/p4/ 2 of 6 4/7/2008 12:55 AM A vector in the direction of the normal to the surface at any point x on the surface is simply n = Qx. Objects Composed of Multiple Surfaces
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 04/06/2008.

Page1 / 6

Program Assignment 4 - CS480 / CS680 Program Assignment 4 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online