Documentation ¶
Index ¶
- type Color
- func (color Color) Add(other Color) Color
- func (color Color) B() float64
- func (color Color) Equal(other Color) bool
- func (color Color) G() float64
- func (color Color) MulColor(other Color) Color
- func (color Color) MulScalar(k float64) Color
- func (color Color) R() float64
- func (color Color) Sub(other Color) Color
- type Intersection
- type IntersectionList
- type Material
- type PointLight
- type Ray
- type Shape
- type Sphere
- type Transform
- func (transform Transform) Chain(other Transform) Transform
- func (transform Transform) Inverse() Transform
- func (transform Transform) RotateX(r float64) Transform
- func (transform Transform) RotateY(r float64) Transform
- func (transform Transform) RotateZ(r float64) Transform
- func (transform Transform) Scale(x, y, z float64) Transform
- func (transform Transform) Shear(x_y, x_z, y_x, y_z, z_x, z_y float64) Transform
- func (transform Transform) Translate(x, y, z float64) Transform
- func (transform Transform) Transpose() Transform
- type Tuple
- func (tuple Tuple) Add(other Tuple) Tuple
- func (tuple Tuple) ApplyTransform(transform Transform) Tuple
- func (tuple Tuple) Cross(other Tuple) Tuple
- func (tuple Tuple) Div(k float64) Tuple
- func (tuple Tuple) Dot(other Tuple) float64
- func (tuple Tuple) Equal(other Tuple) bool
- func (tuple Tuple) IsPoint() bool
- func (tuple Tuple) IsVector() bool
- func (tuple Tuple) Magnitude() float64
- func (tuple Tuple) Mul(k float64) Tuple
- func (tuple Tuple) Neg() Tuple
- func (tuple Tuple) Normalize() Tuple
- func (tuple Tuple) Reflect(normal Tuple) Tuple
- func (tuple Tuple) String() string
- func (tuple Tuple) Sub(other Tuple) Tuple
- func (tuple Tuple) W() float64
- func (tuple Tuple) X() float64
- func (tuple Tuple) Y() float64
- func (tuple Tuple) Z() float64
- type World
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intersection ¶
type IntersectionList ¶
type IntersectionList struct {
// contains filtered or unexported fields
}
func NewIntersectionList ¶
func NewIntersectionList(intersections ...Intersection) IntersectionList
NewIntersectionList creates a sorted list of intersections
func (IntersectionList) Hit ¶
func (intersections IntersectionList) Hit() *Intersection
Hit returns the nearest intersection (or nil, in case there is no intersection)
type PointLight ¶
type Sphere ¶
func (*Sphere) GetMaterial ¶
func (*Sphere) GetTransform ¶
func (*Sphere) Intersect ¶
func (sphere *Sphere) Intersect(ray Ray) IntersectionList
type Transform ¶
type Transform struct {
// contains filtered or unexported fields
}
func NewTransform ¶
func NewTransform() Transform
type Tuple ¶
type Tuple struct {
// contains filtered or unexported fields
}
func (Tuple) ApplyTransform ¶
Click to show internal directories.
Click to hide internal directories.