Versions in this module Expand all Collapse all v0 v0.2.0 May 13, 2020 Changes in this version + type Box struct + func NewBox(p0, p1 Vec3) Box + func (b Box) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (b Box) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) type Camera + AspectRatio float64 type Dielectric + func (d Dielectric) Emit(u, v float64, pos Vec3) Vec3 + type DiffuseLight struct + func (l DiffuseLight) Emit(u, v float64, pos Vec3) Vec3 + func (l DiffuseLight) Scatter(ray Ray, hit HitRecord) (bool, Vec3, Ray) + type FlipFace struct + func (f FlipFace) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (f FlipFace) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type Fog struct + func (f Fog) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (f Fog) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) type Geometry + func NewRotateY(shape Geometry, angle float64) Geometry + type Image struct + func NewImage(file string, xoffset, yoffset float64) Image + func (t Image) Value(u, v float64, pos Vec3) Vec3 + type Isotropic struct + func (i Isotropic) Emit(u float64, v float64, pos Vec3) Vec3 + func (i Isotropic) Scatter(ray Ray, hit HitRecord) (bool, Vec3, Ray) type Lambertian + func (l Lambertian) Emit(u, v float64, pos Vec3) Vec3 + type Marble struct + func (t Marble) Value(u, v float64, pos Vec3) Vec3 type Material + Emit func(u, v float64, pos Vec3) Vec3 type Metal + func (m Metal) Emit(u, v float64, pos Vec3) Vec3 + type Noise struct + func (t Noise) Value(u, v float64, pos Vec3) Vec3 type Ray + RandSource *rand.Rand + type RectXY struct + func (r RectXY) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (r RectXY) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type RectXZ struct + func (r RectXZ) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (r RectXZ) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type RectYZ struct + func (r RectYZ) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (r RectYZ) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type RotateY struct + func (r RotateY) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (r RotateY) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) type Scene + func CornellBox() *Scene + func EarthScene() *Scene + func FinalScene() *Scene + func FoggyCornellBox() *Scene + func LightMarbleScene() *Scene + func MarbleScene() *Scene + func NewScene(camera Camera, world Collection, background Vec3) *Scene + type Translate struct + func (t Translate) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (t Translate) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) type Vec3 + func MaxCoord(u Vec3, v Vec3) Vec3 + func MinCoord(u Vec3, v Vec3) Vec3 v0.1.1 Apr 26, 2020 Changes in this version + var BLACK = Vec3 + var BLUE = Vec3 + var GREEN = Vec3 + var RED = Vec3 + var WHITE = Vec3 + type Actor struct + func (a Actor) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (a Actor) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type Bbox struct + Max Vec3 + Min Vec3 + func (b Bbox) Hit(ray Ray, tMin float64, tMax float64) bool + func (b Bbox) Merge(o Bbox) Bbox + type Camera struct + func NewCamera(lookFrom, lookAt, up Vec3, ...) Camera + func (c Camera) RayTo(s float64, t float64) Ray + type CheckerTexture struct + func (t CheckerTexture) Value(u, v float64, pos Vec3) Vec3 + type Collection []Actor + func (c *Collection) Add(actors ...Actor) + func (c Collection) Bound(tMin float64, tMax float64) (bool, *Bbox) + func (c Collection) Comparator(startTime, endTime float64, axis int) func(i, j int) bool + func (c Collection) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type ConstantTexture struct + func (t ConstantTexture) Value(u, v float64, pos Vec3) Vec3 + type Dielectric struct + func (d Dielectric) Scatter(ray Ray, hit HitRecord) (bool, Vec3, Ray) + type Geometry interface + Bound func(startTime float64, endTime float64) (bool, *Bbox) + Hit func(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type HitRecord struct + Distance float64 + Material Material + Normal Vec3 + Position Vec3 + U float64 + V float64 + type Index struct + func NewIndex(world Collection, start, end int, startTime, endTime float64) Index + func (idx Index) Bound(tMin float64, tMax float64) (bool, *Bbox) + func (idx Index) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type Lambertian struct + func (l Lambertian) Scatter(ray Ray, hit HitRecord) (bool, Vec3, Ray) + type Material interface + Scatter func(ray Ray, hit HitRecord) (bool, Vec3, Ray) + type Metal struct + func NewMetal(albedo Vec3, fuzz float64) Metal + func (m Metal) Scatter(ray Ray, record HitRecord) (bool, Vec3, Ray) + type MovingSphere struct + CenterStart Vec3 + CenterStop Vec3 + Radius float64 + func (s MovingSphere) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (s MovingSphere) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type Ray struct + Direction Vec3 + Origin Vec3 + Time float64 + func (r Ray) At(t float64) Vec3 + type Scene struct + func BookScene() Scene + func MovingSpheres() Scene + func (s Scene) Render() + type Sphere struct + Center Vec3 + Radius float64 + func (s Sphere) Bound(startTime float64, endTime float64) (bool, *Bbox) + func (s Sphere) Hit(ray Ray, tMin float64, tMax float64) (bool, *HitRecord) + type Texture interface + Value func(u, v float64, pos Vec3) Vec3 + type Vec3 struct + X float64 + Y float64 + Z float64 + func RandDisk() Vec3 + func RandSphere() Vec3 + func RandVec() Vec3 + func RandVecInterval(low float64, high float64) Vec3 + func (u Vec3) Add(v Vec3) Vec3 + func (u Vec3) AsArray() [3]float64 + func (u Vec3) Cross(v Vec3) Vec3 + func (u Vec3) Div(t float64) Vec3 + func (u Vec3) Dot(v Vec3) float64 + func (u Vec3) GetColor(samples int) color.RGBA + func (u Vec3) Mul(v Vec3) Vec3 + func (u Vec3) Neg() Vec3 + func (u Vec3) Norm() float64 + func (u Vec3) Reflect(n Vec3) Vec3 + func (u Vec3) Refract(n Vec3, nRatio float64) (bool, Vec3) + func (u Vec3) Scale(t float64) Vec3 + func (u Vec3) SquareNorm() float64 + func (u Vec3) Sub(v Vec3) Vec3 + func (u Vec3) Unit() Vec3