BuildMultipleObjects

- add_object(sphere_ptr a use constructor to set centre and radius sphere_ptr = new Sphere(Point3D(0 30 0 60 sphere_ptr>set_color(1 1 0 yellow

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
void v World::build(void) { vp.set_hres(200); vp.set_vres(200); vp.set_pixel_size(1.0); v tracer_ptr = new MultipleObjects(this); t background_color = RGBColor(black); b // use access functions to set centre and radius / Sphere* sphere_ptr = new Sphere; sphere_ptr->set_center(0, -25, 0); sphere_ptr->set_radius(80); sphere_ptr->set_color(1, 0, 0); // red
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: add_object(sphere_ptr); a // use constructor to set centre and radius / sphere_ptr = new Sphere(Point3D(0, 30, 0), 60); sphere_ptr->set_color(1, 1, 0); // yellow add_object(sphere_ptr); a Plane* plane_ptr = new Plane(Point3D(0), Normal(0, 1, 1)); plane_ptr->set_color(0.0, 0.3, 0.0); // dark green add_object(plane_ptr); }...
View Full Document

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

Ask a homework question - tutors are online