Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASCIISF ¶
ASCIISF is the original SetFunc as described in the original implementation. Assumes L ranges from -sqrt(2) to +sqrt(2).
func Gray16Palette ¶
Gray16Palette returns 15 Gray16 colors plus a transparent color.
Types ¶
type Scene ¶
type Scene struct {
// Dimensions of the viewport.
Width, Height int
// Distance from camera to viewport.
K1 float64
// Distance from camera to torus. Essentially equal to TZ since camera is at origin.
K2 float64
// Light source vector. Technically should be normalized, but up to the implementation.
LX, LY, LZ float64
}
Scene contains locations and properties of the scene.
func (*Scene) CalculateK1 ¶
CalculateK1 is optional. Automatically sets K1 such that the given torus stays within the screen.
type Torus ¶
type Torus struct { // Controls the resolution of the cross-sectional circle. ThetaSpacing float64 // Controls the resolution of the revolution of the circle. PhiSpacing float64 // Radius of the cross-sectional circle. R1 float64 // Distance from axis of revolution (Y) to the center of the cross-sectional circle. R2 float64 // Rotation of the torus along the X and Z axes. A, B float64 }
Torus contains properties of the torus to be rendered.
func DefaultTorus ¶
func DefaultTorus() Torus
Click to show internal directories.
Click to hide internal directories.