MeshTriangle

MeshTriangle - package raytracer.geometricObjects; import

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

View Full Document Right Arrow Icon
package raytracer.geometricObjects; import raytracer.utility.*; // Copyright (C) Kevin Suffern 2000-2007. // This C++ code is for non-commercial purposes only. // This C++ code is licensed under the GNU General Public License Version 2. // See the file COPYING.txt for the full license. // This file contains the declaration of the class MeshTriangle // Triangle classes derived from MeshTriangle, such as FlatMeshTriangle and SmoothMeshTriangle, // are stored in a regular grid for rendering triangle meshes // A mesh triangle stores integer indices into the vertices array in a Mesh object // A mesh triangle also stores a pointer to the Mesh object // A mesh triangle also stores the normal for use in FlatMeshTriangle and for // computing the average normal at each vertex for SmoothMeshTriangles // A mesh triangle defines the shadow hit function because this is independent of whether the // triangle is flat shaded or smooth shaded or uv mapped or not uv mapped // MeshTriangle doesn't inherit from the Triangle class discussed in Chapter 19, // because Triangle stores the vertices and a normal public abstract class MeshTriangle extends GeometricObject { public Mesh mesh; // stores all the data public int index0, index1, index2; // indices into the vertices array in the mesh public Normal normal; public float area; // required for translucency // ---------------------------------------------------------------- default constructor public MeshTriangle() {
Background image of page 1

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

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

Page1 / 4

MeshTriangle - 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