Documentation ¶
Index ¶
- func Clamp(value, min, max float32) float32
- type Accumulator
- type Camera
- type CameraMoveDirection
- type Color
- type Intersectable
- type Material
- type MaterialType
- type Plane
- type Primitive
- type Quad
- type Ray
- type RayInfo
- type Scene
- type Sphere
- type Tracer
- type Triangle
- type Vector
- func (v1 Vector) Add(v2 Vector) Vector
- func (v1 Vector) Cross(v2 Vector) Vector
- func (v1 Vector) Dot(v2 Vector) float64
- func (v Vector) Length() float64
- func (v Vector) LengthSquared() float64
- func (v Vector) Multiply(scalar float64) Vector
- func (v Vector) Normalize() Vector
- func (v1 Vector) Subtract(v2 Vector) Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accumulator ¶
type Accumulator struct { Data []Color Bounds image.Rectangle // contains filtered or unexported fields }
func NewAccumulator ¶
func NewAccumulator(bounds image.Rectangle) *Accumulator
func (*Accumulator) DrawContents ¶
func (a *Accumulator) DrawContents(screen wde.Image)
func (*Accumulator) NextFrame ¶
func (a *Accumulator) NextFrame()
func (*Accumulator) Reset ¶
func (a *Accumulator) Reset()
type Camera ¶
type Camera struct {
Eye, Direction, Up Vector
// contains filtered or unexported fields
}
func (*Camera) GenerateRays ¶
type CameraMoveDirection ¶
type CameraMoveDirection int
type Intersectable ¶
type Material ¶
type Material struct { Color Color Type MaterialType Specularity float32 }
type Primitive ¶
type Primitive struct { Intersectable // contains filtered or unexported fields }
type Scene ¶
type Scene struct { Objects []Intersectable Background Color }
func DefaultScene ¶
func DefaultScene() *Scene
func (*Scene) AddObject ¶
func (s *Scene) AddObject(t Intersectable)
type Sphere ¶
type Tracer ¶
type Tracer struct { Camera *Camera // contains filtered or unexported fields }
func (*Tracer) TraceRegion ¶
type Triangle ¶
func NewTriangle ¶
Click to show internal directories.
Click to hide internal directories.