|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--Renderer
|
+--FlatRenderer
|
+--GouraudRenderer
Renders Gouraud; intensity-value interpolation proposed by Gouraud.
This class defines inner subclasses of EdgeEntry, EdgeTable, and PolygonInfo.
The EdgeEntryEx class, a subclass of EdgeEntry, contains the intensity values for the two vertices of the edge.
The EdgeTableEx class, a subclass of EdgeTable, is required in order to create instances of EdgeEntryEx containing intensity values gained from PolygonInfoEx.
The PolygonInfoEx class calculates the intensity values for each vertice in a polygon.
The MeshInfo class calculates and contains the normal vector for each vertice in a mesh.
Known Bugs:
When using parallel projection, the lights are not projected with the mesh,
so rendering sometimes results with unlit objects because the lights are
behind the objects.
GouraudRenderer.EdgeEntryEx,
GouraudRenderer.EdgeTableEx,
GouraudRenderer.PolygonInfoEx,
GouraudRenderer.MeshInfo| Inner Class Summary | |
protected static class |
GouraudRenderer.EdgeEntryEx
Extended edge entry containing intensity information at each entry. |
protected static class |
GouraudRenderer.EdgeTableEx
Extended Edge Table containing intensity information at each edge entry. |
protected static class |
GouraudRenderer.MeshInfo
Information about rendering a mesh. |
protected static class |
GouraudRenderer.PolygonInfoEx
Extended polygon info containing information about the intensities of each vertices. |
| Inner classes inherited from class FlatRenderer |
FlatRenderer.ActiveEdgeTable,
FlatRenderer.EdgeBucket,
FlatRenderer.EdgeEntry,
FlatRenderer.EdgeTable,
FlatRenderer.PolygonInfo |
| Field Summary | |
protected Map |
meshTable
A Set of (Mesh,MeshInfo objects) pairs describing the mesh. |
| Fields inherited from class FlatRenderer |
colorBuffer,
depthBuffer,
lights,
polygonTable,
projectedMeshes,
xmin |
| Fields inherited from class Renderer |
AMBIENT_BLUE,
AMBIENT_GREEN,
AMBIENT_RED,
backingStore,
CS_REALWORLD,
FATT_C1,
FATT_C2,
FATT_C3,
metafile,
owner,
viewPlane |
| Constructor Summary | |
GouraudRenderer(Component owner)
|
|
| Method Summary | |
protected void |
fillPixels(FlatRenderer.PolygonInfo info,
FlatRenderer.ActiveEdgeTable AET,
int xmin,
int y)
Fills a line of pixels from the AET. |
protected void |
initPolygonTable()
Initializes the polygon table with PolygonInfoEx instances using the current meshes in projectedMeshes. |
protected Mesh |
normalizeMesh(Mesh mesh)
Normalize a mesh into vieplane coordinates. |
protected void |
normalizeMeshes()
Normalizes all the mesh objects into viewplane coordinates |
protected void |
notifyDataChanged()
Called when there are changes to the Renderer data. |
protected void |
paintLights(Graphics g)
Paints the lights objects |
| 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 |
|
| Field Detail |
protected Map meshTable
| Constructor Detail |
public GouraudRenderer(Component owner)
| Method Detail |
protected void notifyDataChanged()
protected void paintLights(Graphics g)
protected Mesh normalizeMesh(Mesh mesh)
mesh - the source mesh to project.protected void normalizeMeshes()
FlatRenderer.projectedMeshesprotected void initPolygonTable()
FlatRenderer.projectedMeshes,
FlatRenderer.polygonTable,
FlatRenderer.PolygonInfo
protected void fillPixels(FlatRenderer.PolygonInfo info,
FlatRenderer.ActiveEdgeTable AET,
int xmin,
int y)
AET - the current active-edge table.g - the drawing surface.xmin - the minimum x-coordinate.y - the current y-coordinate of the line.FlatRenderer.depthBuffer,
FlatRenderer.colorBuffer
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||