Class PhongRenderer
java.lang.Object
|
+--Renderer
|
+--FlatRenderer
|
+--GouraudRenderer
|
+--PhongRenderer
- public class PhongRenderer
- extends GouraudRenderer
Renders Phong; normal-vector interpolation algorithm proposed by Phong
Bui-Tong.
This class defines inner subclasses of FlatRenderer.EdgeEntry,
GouraudRenderer.PolygonInfoEx and GouraudRenderer.EdgeTableEx.
class EdgeEntryEx (subclass of FlatRenderer.EdgeEntry) contains the
normal vector for the starting and ending vertice of the edge.
class EdgeTableEx (subclass of GouraudRenderer.EdgeTableEx) is required
to construct instances of EdgeEntryEx. It also contains a MeshInfo
instance for the owning mesh of the polygon edges in the table. The
MeshInfo instance is required to feed EdgeTableEx constructor with
vertice normals.
class PolygonInfoEx (subclass of GouraudRenderer.PolygonInfoEx ) is only
required to construct instances of EdgeTableEx.
- Author:
- Sasmito Adibowo
- See Also:
PhongRenderer.PolygonInfoEx,
PhongRenderer.EdgeEntryEx,
PhongRenderer.EdgeTableEx
| Fields inherited from class Renderer |
AMBIENT_BLUE,
AMBIENT_GREEN,
AMBIENT_RED,
backingStore,
CS_REALWORLD,
FATT_C1,
FATT_C2,
FATT_C3,
metafile,
owner,
viewPlane |
| Methods inherited from class FlatRenderer |
getProjectionMatrix,
initLineBuffers,
makeCoorSysMatrices,
paint,
processPolygon,
processScanLine,
projectMatrix,
projectMesh,
projectMeshes,
render,
roundCoord,
transformLights |
| Methods inherited from class Renderer |
drawGrid,
getMetafile,
getSize,
initBackingStore,
makeParallelProjection,
makePerspectiveProjection,
moveCamera,
overlaps,
parallelProjection,
rotateCameraX,
rotateCameraY,
rotateCameraZ,
rotateCoorSysX,
rotateCoorSysY,
rotateCoorSysZ,
setMetafile,
setupCartesian,
translateCoorSys |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
PhongRenderer
public PhongRenderer(Component owner)
initPolygonTable
protected void initPolygonTable()
- Initializes the polygon table with PolygonInfoEx instances
using the current meshes in projectedMeshes.
- Overrides:
- initPolygonTable in class GouraudRenderer
- See Also:
FlatRenderer.projectedMeshes,
FlatRenderer.polygonTable,
FlatRenderer.PolygonInfo
fillPixels
protected void fillPixels(FlatRenderer.PolygonInfo info,
FlatRenderer.ActiveEdgeTable AET,
int xmin,
int y)
- Fills a line of pixels from the AET. Updates depthBuffer and colorBuffer.
- Overrides:
- fillPixels in class GouraudRenderer
- Parameters:
AET - the current active-edge table.g - the drawing surface.xmin - the minimum x-coordinate.y - the current y-coordinate of the line.- See Also:
FlatRenderer.depthBuffer,
FlatRenderer.colorBuffer