Documentation ¶
Index ¶
- func DefaultWorldLight() object.PointLight
- func Intersect(w World, r ray.Ray) (intersections object.Intersections)
- func ReflectedColor(w World, comps Computation, remaining int) object.RGB
- func RefractedColor(w World, comps Computation, remaining int) object.RGB
- func Schlick(comps Computation) float64
- func ShadeHit(w World, comps Computation, remaining int) object.RGB
- type Camera
- type Canvas
- type Computation
- func (c Computation) Eyev() ray.Vector
- func (c Computation) Inside() bool
- func (c Computation) Intersect() float64
- func (c Computation) N1() float64
- func (c Computation) N2() float64
- func (c Computation) Normalv() ray.Vector
- func (c Computation) Object() object.Object
- func (c Computation) OverPoint() ray.Vector
- func (c Computation) Point() ray.Vector
- func (c Computation) Reflectv() ray.Vector
- func (c Computation) UnderPoint() ray.Vector
- type World
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultWorldLight ¶
func DefaultWorldLight() object.PointLight
func ReflectedColor ¶
func ReflectedColor(w World, comps Computation, remaining int) object.RGB
func RefractedColor ¶
func RefractedColor(w World, comps Computation, remaining int) object.RGB
func Schlick ¶
func Schlick(comps Computation) float64
Types ¶
type Camera ¶
type Camera interface { HSize() int VSize() int Origin() ray.Vector PixelSize() float64 FocalLength() float64 RayForPixel(nx, ny float64) ray.Ray FieldOfView() float64 SetTransform(by ray.Matrix) error }
func NewBasicCamera ¶
type Computation ¶
type Computation struct {
// contains filtered or unexported fields
}
func PrepareComputations ¶
func PrepareComputations(i object.Intersection, r ray.Ray, xs ...object.Intersection) (comps Computation)
func (Computation) Eyev ¶
func (c Computation) Eyev() ray.Vector
func (Computation) Inside ¶
func (c Computation) Inside() bool
func (Computation) Intersect ¶
func (c Computation) Intersect() float64
func (Computation) N1 ¶
func (c Computation) N1() float64
func (Computation) N2 ¶
func (c Computation) N2() float64
func (Computation) Normalv ¶
func (c Computation) Normalv() ray.Vector
func (Computation) Object ¶
func (c Computation) Object() object.Object
func (Computation) OverPoint ¶
func (c Computation) OverPoint() ray.Vector
func (Computation) Point ¶
func (c Computation) Point() ray.Vector
func (Computation) Reflectv ¶
func (c Computation) Reflectv() ray.Vector
func (Computation) UnderPoint ¶
func (c Computation) UnderPoint() ray.Vector
type World ¶
type World interface { Objects() []object.Object AddObject(obj object.Object) AddObjects(objs ...object.Object) Light() object.PointLight AddLight(light object.PointLight) ColorAt(r ray.Ray, remaining int) object.RGB IsShadowed(point ray.Vector) bool }
func DefaultWorld ¶
func DefaultWorldWithGroups ¶
func TwoSphereWorld ¶
func TwoSphereWorld() World
Click to show internal directories.
Click to hide internal directories.