Documentation ¶
Index ¶
- type Canvas
- func (c *Canvas) Clear()
- func (c *Canvas) DrawLine(a U16Vec2, b U16Vec2, col Color)
- func (c *Canvas) DrawLineC(a I16Vec2, b I16Vec2, col Color)
- func (c *Canvas) DrawLineF(a U16Frag, b U16Frag, f Material, normal F32Vec3)
- func (c *Canvas) DrawLineFC(a I16Frag, b I16Frag, f Material, normal F32Vec3)
- func (c *Canvas) DrawLineI(a U16Vec2C, b U16Vec2C)
- func (c *Canvas) DrawLineIC(a I16Vec2C, b I16Vec2C)
- func (c *Canvas) DrawTriangle(p0 U16Vec2, p1 U16Vec2, p2 U16Vec2, col Color)
- func (c *Canvas) DrawTriangleC(p0 I16Vec2, p1 I16Vec2, p2 I16Vec2, col Color)
- func (c *Canvas) DrawTriangleF(p0 U16Frag, p1 U16Frag, p2 U16Frag, f Material, normal F32Vec3)
- func (c *Canvas) DrawTriangleFC(p0 I16Frag, p1 I16Frag, p2 I16Frag, f Material, normal F32Vec3)
- func (c *Canvas) DrawTriangleI(p0 U16Vec2C, p1 U16Vec2C, p2 U16Vec2C)
- func (c *Canvas) DrawTriangleIC(p0 I16Vec2C, p1 I16Vec2C, p2 I16Vec2C)
- func (c *Canvas) Fill(col Color)
- func (c *Canvas) Print()
- func (c *Canvas) PrintD(d *Canvas)
- func (c *Canvas) PrintT()
- func (c *Canvas) PrintZ()
- func (c *Canvas) SetPixel(pos U16Vec2, col Color)
- func (c *Canvas) SetPixelC(pos I16Vec2, col Color)
- type Color
- type F32Vec2
- type F32Vec3
- type I16Frag
- type I16Vec2
- type I16Vec2C
- type Material
- type MaterialFlat
- type MaterialImage
- type MaterialNormal
- type MaterialPseudoRandom
- type MaterialPseudoRandomRGB
- type MaterialUV
- type Pixel
- type U16Frag
- type U16Vec2
- type U16Vec2C
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas struct { Ccolor Color // contains filtered or unexported fields }
Canvas object, stores pixels and stuff
func (*Canvas) DrawLineFC ¶
func (*Canvas) DrawLineIC ¶
Same as DrawLineI but {0, 0} is canvas center
func (*Canvas) DrawTriangle ¶
Draws filled triangle using scan line algorithm
func (*Canvas) DrawTriangleC ¶
Same as DrawTriangle but {0, 0} is center of canvas
func (*Canvas) DrawTriangleF ¶
func (*Canvas) DrawTriangleFC ¶
func (*Canvas) DrawTriangleI ¶
Draws filled triangle with colors interpolated between points
func (*Canvas) DrawTriangleIC ¶
Same as DrawTriangleI but {0, 0} is canvas center
func (*Canvas) Print ¶
func (c *Canvas) Print()
Prints canvas to terminal, using escape sequences for colors and `▄` for smaller pixels
func (*Canvas) PrintT ¶
func (c *Canvas) PrintT()
Prints canvas to terminal, but if ignores pixels which have z equal math.MaxFloat32
type MaterialImage ¶
type MaterialNormal ¶
type MaterialNormal struct{}
pi -> 255 Material that will return color based on normals
type MaterialPseudoRandom ¶
type MaterialPseudoRandom struct {
// contains filtered or unexported fields
}
type MaterialPseudoRandomRGB ¶
type MaterialPseudoRandomRGB struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.