CS488 PA9
Public Member Functions | Private Attributes | List of all members
GouraudShader Class Reference

#include <GouraudShader.h>

Inherits Colorizer.

Public Member Functions

 GouraudShader (Vector< 4 > light, Vector< 4 > viewer)
 
Color calculateColor (int fromSideFirstIndex, int fromSideSecondIndex, double lambda, int toSideFirstIndex, int toSideSecondIndex, double rho, double tau)
 
virtual void setTriangle (Triangle *triangle)
 

Private Attributes

double intensities [3]
 
Vector< 4 > light
 
Vector< 4 > viewer
 

Detailed Description

A GouraudShader

Constructor & Destructor Documentation

◆ GouraudShader()

GouraudShader::GouraudShader ( Vector< 4 >  light,
Vector< 4 >  viewer 
)

Explicit Value Constructor.

Parameters
lightThe location of the light source (not the direction vector)
viewerThe location of the viewer (not the direction vector)

Member Function Documentation

◆ calculateColor()

Color GouraudShader::calculateColor ( int  fromSideFirstIndex,
int  fromSideSecondIndex,
double  lambda,
int  toSideFirstIndex,
int  toSideSecondIndex,
double  rho,
double  tau 
)

Calculate the Color of a pixel.

Parameters
fromSideFirstIndexThe first index of the from side
fromSideSecondIndexThe second index of the from side
lambdaThe weight for the from side
toSideFirstIndexThe first index of the to side
toSideSecondIndexThe second index of the to side
rhoThe weight for the to side
tauThe side-to-side weight
Returns
The Color

◆ setTriangle()

void GouraudShader::setTriangle ( Triangle *  triangle)
virtual

Set the Triangle.

Parameters
triangleA pointer to the Triangle to use

Member Data Documentation

◆ intensities

double GouraudShader::intensities[3]
private

The intensities of the red, green and blue channels.

◆ light

Vector<4> GouraudShader::light
private

The light direction.

◆ viewer

Vector<4> GouraudShader::viewer
private

The viewer direction.


The documentation for this class was generated from the following files: