Documentation ¶
Index ¶
- func Clamp(x float64, min float64, max float64) float64
- func DegreesToRadians(degrees float64) float64
- func DielectricScatter(rIn Ray, rec *HitRecord, attenuation *Vector, scattered *Ray, mat Material) bool
- func IsotropicScatter(rIn Ray, rec *HitRecord, attenuation *Vector, scattered *Ray, mat Material) bool
- func LambertianScatter(rIn Ray, rec *HitRecord, attenuation *Vector, scattered *Ray, mat Material) bool
- func LightScatter(rIn Ray, rec *HitRecord, attenuation *Vector, scattered *Ray, mat Material) bool
- func MetalScatter(rIn Ray, rec *HitRecord, attenuation *Vector, scattered *Ray, mat Material) bool
- func Min(a float64, b float64) float64
- func RandomFloat64() float64
- func RandomFloat64Range(min float64, max float64) float64
- func Reflectance(cosine float64, refIdx float64) float64
- func SeedRandom()
- func WriteColourPPM(pixel Vector, samplesPerPixel int)
- func WritePPMHeader(imageWidth int, imageHeight int)
- type Box
- type Camera
- type Colour
- type ConstantMedium
- type HitRecord
- type Image
- type Material
- type Object
- type Ray
- type RotateY
- type ScatterFunc
- type Scene
- type Sphere
- type Translate
- type Vector
- func (v Vector) Add(v2 Vector) Vector
- func (v Vector) Cross(v2 Vector) Vector
- func (v Vector) Divide(v2 Vector) Vector
- func (v Vector) DivideN(n float64) Vector
- func (v Vector) Dot(v2 Vector) float64
- func (v Vector) Length() float64
- func (v Vector) LengthSquared() float64
- func (v Vector) Minus(v2 Vector) Vector
- func (v Vector) MinusN(n float64) Vector
- func (v Vector) Multiply(v2 Vector) Vector
- func (v Vector) MultiplyN(n float64) Vector
- func (v Vector) NearZero() bool
- func (v Vector) UnitVector() Vector
- type XYRect
- type XZRect
- type YZRect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DegreesToRadians ¶
func DielectricScatter ¶
func IsotropicScatter ¶
func LambertianScatter ¶
func LightScatter ¶
func MetalScatter ¶
func RandomFloat64 ¶
func RandomFloat64() float64
func RandomFloat64Range ¶
func Reflectance ¶
func SeedRandom ¶
func SeedRandom()
func WriteColourPPM ¶
func WritePPMHeader ¶
Types ¶
type Camera ¶
type Camera struct { AspectRatio float64 ViewportHeight float64 ViewportWidth float64 FocalLength float64 Origin Vector Horizontal Vector Vertical Vector LowerLeftCorner Vector LensRadius float64 U Vector V Vector W Vector }
type ConstantMedium ¶
type HitRecord ¶
func (*HitRecord) SetFaceNormal ¶
type RotateY ¶
func NewRotateY ¶
type ScatterFunc ¶
type Vector ¶
func RandomInUnitDisk ¶
func RandomInUnitDisk() Vector
func RandomInUnitSphere ¶
func RandomInUnitSphere() Vector
func RandomUnitVector ¶
func RandomUnitVector() Vector
func RandomVector ¶
func (Vector) LengthSquared ¶
func (Vector) UnitVector ¶
Click to show internal directories.
Click to hide internal directories.