Documentation ¶
Overview ¶
Implementation of Cohen-Sutherland line clipping.
Color primitives.
Line-drawing primitives.
Polygon fill function, using integers only.
GIF composition and encoding.
Initialization and output primitives.
Triangulation of polygons. Triangulation of a polygon with successive vertex numbers pol[0], ..., pol[n-1], in counter-clockwise order. With three given vertex numbers P, Q, R, function orienta must determine their orientation.
Negative = clockwise Zero = collinear Positive = counter-clockwise
If triangulation is possible, the resulting triangles are successively stored in array 'nrs'. Triangle j has vertex numbers nrs[j].A, nrs[j].B, nrs[j].C. Memory space for slice 'nrs' must be supplied by the caller. Return value: the number of triangles found, or -1 if no proper polygon, or vertices are clockwise
Conversion from world coordinates to viewport coordinates.
Index ¶
- Variables
- func AppendPlot(x, y float64, code int)
- func ClipDraw(xP, yP, xQ, yQ float64)
- func Draw(x, y float64)
- func DrawLine(xP, yP, xQ, yQ int)
- func EndGr()
- func Error(err error)
- func Fill(X []int, Y []int)
- func Frame(delay int)
- func GenPlot()
- func GetMaxColor() int
- func HorLine(xLeft, xRight, y int)
- func IX(x float64) int
- func IY(y float64) int
- func InitGr(filename string)
- func InitWindow()
- func Move(x, y float64)
- func PutPix(x, y int)
- func SetBackgroundColor(c int)
- func SetClipBoundaries(x1, x2, y1, y2 float64)
- func SetColor(c int)
- func SetRGBPalette(index, r, g, b int)
- func ShadedColors()
- func Triangul(pol []int, n int, nrs []Trianrs, orienta func(int, int, int) int) int
- func UpdateWindowBoundaries(x, y float64)
- func ViewportBoundaries(Xmin, Xmax, Ymin, Ymax, reductionFactor float64)
- func XViewport(x float64) float64
- func YViewport(y float64) float64
- type Trianrs
- type Vec
Constants ¶
This section is empty.
Variables ¶
var ( NColors int ForeGrColor int = 14 BackGrColor int = 0 )
var ( ImageWidth int = 800 // X__max ImageHeight int = 600 // Y__max )
Functions ¶
func AppendPlot ¶
func GetMaxColor ¶
func GetMaxColor() int
func InitWindow ¶
func InitWindow()
func SetBackgroundColor ¶
func SetBackgroundColor(c int)
func SetClipBoundaries ¶
func SetClipBoundaries(x1, x2, y1, y2 float64)
func SetRGBPalette ¶
func SetRGBPalette(index, r, g, b int)
func ShadedColors ¶
func ShadedColors()
func UpdateWindowBoundaries ¶
func UpdateWindowBoundaries(x, y float64)
func ViewportBoundaries ¶
func ViewportBoundaries(Xmin, Xmax, Ymin, Ymax, reductionFactor float64)