com.brackeen.javagamebook.graphics3D
Class ScanConverter

java.lang.Object
  extended bycom.brackeen.javagamebook.graphics3D.ScanConverter
Direct Known Subclasses:
SortedScanConverter

public class ScanConverter
extends java.lang.Object

The ScanConverter class converts a projected polygon into a series of horizontal scans for drawing.


Nested Class Summary
static class ScanConverter.Scan
          A horizontal scan line.
 
Constructor Summary
ScanConverter(ViewWindow view)
          Creates a new ScanConverter for the specified ViewWindow.
 
Method Summary
 boolean convert(Polygon3D polygon)
          Scan-converts a projected polygon.
 int getBottomBoundary()
          Gets the bottom boundary of the last scan-converted polygon.
 ScanConverter.Scan getScan(int y)
          Gets the scan line for the specified y value.
 int getTopBoundary()
          Gets the top boundary of the last scan-converted polygon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScanConverter

public ScanConverter(ViewWindow view)
Creates a new ScanConverter for the specified ViewWindow. The ViewWindow's properties can change in between scan conversions.

Method Detail

getTopBoundary

public int getTopBoundary()
Gets the top boundary of the last scan-converted polygon.


getBottomBoundary

public int getBottomBoundary()
Gets the bottom boundary of the last scan-converted polygon.


getScan

public ScanConverter.Scan getScan(int y)
Gets the scan line for the specified y value.


convert

public boolean convert(Polygon3D polygon)
Scan-converts a projected polygon. Returns true if the polygon is visible in the view window.