Triangle - package raytracer.geometricObjects; import...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: package raytracer.geometricObjects; import raytracer.utility.*; //this is the triangle discussed in Section 19.3 public class Triangle extends GeometricObject { private Point3D v0, v1, v2; private Normal normal; // ---------------------------------------------------------------- default constructor public Triangle(){ super(); v0 = new Point3D(0,0,0); v1 = new Point3D(0,0,1); v2 = new Point3D(1,0,0); normal = new Normal(0,1,0); } // ---------------------------------------------------------------- constructor public Triangle (Point3D a, Point3D b, Point3D c){ super(); v0 = new Point3D(a); v1 = new Point3D(b); v2 = new Point3D(c); compute_normal(); } // ---------------------------------------------------------------- copy constructor public Triangle (Triangle triangle){ super(triangle); v0 = new Point3D(triangle.v0); v1 = new Point3D(triangle.v1); v2 = new Point3D(triangle.v2); normal = new Normal(triangle.normal); } // ---------------------------------------------------------------- clone public Triangle clone() {...
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.

Page1 / 4

Triangle - package raytracer.geometricObjects; import...

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

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