Documentation ¶
Index ¶
- Constants
- type BaseMaterial
- type Camera
- type CameraInput
- type Dielectric
- type HitRecord
- type Hitable
- type HitableList
- type ImageInput
- type Lambertian
- type Light
- type Material
- type Metal
- type ObjectType
- type ObjectsInput
- type Pixel
- type Ray
- type Scene
- type SceneInput
- type Setting
- type Specification
- type Sphere
- type SphereInput
- type SurfaceInput
- type Vector
- func (v *Vector) AddScaledVector(v1 *Vector, t float64) *Vector
- func (v *Vector) AddVector(v1 *Vector) *Vector
- func (v *Vector) Copy() *Vector
- func (v *Vector) Dot(v1 *Vector) float64
- func (v *Vector) Gamma2()
- func (v *Vector) Length() float64
- func (v *Vector) MakeUnitVector() *Vector
- func (v *Vector) MultiplyVector(v1 *Vector) *Vector
- func (v *Vector) Negate() *Vector
- func (v *Vector) Reflect(n *Vector) *Vector
- func (v *Vector) Scale(t float64) *Vector
- func (v *Vector) SquaredLength() float64
- func (v *Vector) SubtractScaledVector(v1 *Vector, t float64) *Vector
- func (v *Vector) SubtractVector(v1 *Vector) *Vector
- func (v *Vector) ToPixel(i, j int) *Pixel
- func (v *Vector) Update(x, y, z float64) *Vector
- func (v *Vector) VectorCrossProduct(v1, v2 *Vector) *Vector
- func (v *Vector) X() float64
- func (v *Vector) Y() float64
- func (v *Vector) Z() float64
Constants ¶
View Source
const ( LambertianMaterial = "Lambertian" MetalMaterial = "Metal" DielectricMaterial = "Dielectric" LightMaterial = "Light" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMaterial ¶
type BaseMaterial struct { Albedo *Vector // contains filtered or unexported fields }
func NewBaseMaterial ¶
func NewBaseMaterial(albedo *Vector, isLight bool) *BaseMaterial
func (*BaseMaterial) IsLight ¶
func (b *BaseMaterial) IsLight() bool
type Camera ¶
type Camera struct {
LowerLeftCorner, Origin *Vector
Horizontal, Vertical *Vector
LensRadius float64
U, V, W *Vector
}
type CameraInput ¶
type Dielectric ¶
type Dielectric struct { *BaseMaterial RefIndex float64 }
func NewDielectric ¶
func NewDielectric(albedo *Vector, r float64) *Dielectric
type HitableList ¶
type HitableList struct {
List []Hitable
}
func (*HitableList) AddHitable ¶
func (hl *HitableList) AddHitable(h Hitable)
type ImageInput ¶
type Lambertian ¶
type Lambertian struct {
*BaseMaterial
}
func NewLambertian ¶
func NewLambertian(albedo *Vector) *Lambertian
type Light ¶
type Light struct {
*BaseMaterial
}
type Metal ¶
type Metal struct { *BaseMaterial // contains filtered or unexported fields }
type ObjectType ¶
type ObjectType int
type ObjectsInput ¶
type ObjectsInput struct {
Spheres []SphereInput
}
type Ray ¶
func (*Ray) PointAtParameter ¶
type Scene ¶
type Scene struct { Camera *Camera HitableList *HitableList AmbientLight *Vector }
type SceneInput ¶
type SceneInput struct { Camera CameraInput Objects ObjectsInput AmbientLight [3]float64 }
type Specification ¶
type Specification struct { Settings Setting Image ImageInput Scene SceneInput }
func (Specification) GetCamera ¶
func (w Specification) GetCamera() *Camera
func (Specification) GetHitableList ¶
func (w Specification) GetHitableList() *HitableList
func (Specification) GetScene ¶
func (w Specification) GetScene() *Scene
type SphereInput ¶
type SphereInput struct { Center [3]float64 Radius float64 Surface SurfaceInput }
type SurfaceInput ¶
type Vector ¶
type Vector struct {
// contains filtered or unexported fields
}
func NewEmptyVector ¶
func NewEmptyVector() *Vector
func NewVectorFromArray ¶
func RandomPointInUnitDisk ¶
func RandomPointInUnitSphere ¶
func (*Vector) MakeUnitVector ¶
func (*Vector) MultiplyVector ¶
func (*Vector) SquaredLength ¶
func (*Vector) SubtractScaledVector ¶
func (*Vector) SubtractVector ¶
func (*Vector) VectorCrossProduct ¶
Click to show internal directories.
Click to hide internal directories.