core

package
v0.0.0-...-8bc4307 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2023 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBvhNode

func NewBvhNode(objects ObjectList, time0, time1 Double) *bvhNode

func NewConstantMedium

func NewConstantMedium(boundary Object, density Double, texture Texture) *constantMedium

func NewDielectric

func NewDielectric(refIdx Double) *dielectric

func NewDiffuseLight

func NewDiffuseLight(emit Texture) *diffuseLight

func NewIsotropic

func NewIsotropic(albedo Texture) *isotropic

func NewLambertian

func NewLambertian(albedo Texture) *lambertian

func NewMetal

func NewMetal(albedo Color, fuzz Double) *metal

func NewMovingSphere

func NewMovingSphere(center1, center2 Vec3, radius Double, mat Material, time0, time1 Double) *movingSphere

func NewRotateY

func NewRotateY(obj Object, angle Double) *rotateY

func NewSphere

func NewSphere(center Vec3, radius Double, mat Material) *sphere

func NewXYRect

func NewXYRect(x0, x1, y0, y1, k Double, material Material) *xyRect

func NewXZRect

func NewXZRect(x0, x1, z0, z1, k Double, material Material) *xzRect

func NewYZRect

func NewYZRect(y0, y1, z0, z1, k Double, material Material) *yzRect

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

func NewBox

func NewBox(p0, p1 Vec3, material Material) *Box

type Camera

type Camera struct {
	Origin          Vec3
	LowerLeftCorner Vec3
	// contains filtered or unexported fields
}

func NewCamera

func NewCamera(
	aspectRatio, vfov, aperture, focusDist Double,
	lookFrom, lookAt, vup Vec3,
	time0, time1 Double) *Camera

func (*Camera) GetRay

func (c *Camera) GetRay(u, v Double) *Ray

type CheckerTexture

type CheckerTexture struct {
	// contains filtered or unexported fields
}

Checker

func NewCheckerTexture

func NewCheckerTexture(odd, even Texture) *CheckerTexture

type Color

type Color struct {
	R, G, B Double
}

func NewColor

func NewColor(r, g, b Double) Color

func NewColorRandom

func NewColorRandom(min, max Double) Color

func (Color) Add

func (c Color) Add(x Color) Color

func (Color) Mul

func (c Color) Mul(n Double) Color

func (Color) MulVec

func (c Color) MulVec(x Color) Color

type Double

type Double = float64

type ImageTexture

type ImageTexture struct {
	// contains filtered or unexported fields
}

Image

func NewImageTexture

func NewImageTexture(src image.Image) *ImageTexture

type Material

type Material interface {
	// contains filtered or unexported methods
}

type NoiseTexture

type NoiseTexture struct {
	// contains filtered or unexported fields
}

Noise

func NewNoiseTexture

func NewNoiseTexture(scale Double) *NoiseTexture

type Object

type Object interface {
	// contains filtered or unexported methods
}

type ObjectList

type ObjectList []Object

type Ray

type Ray struct {
	Origin    Vec3
	Direction Vec3
	Time      Double
}

func NewRay

func NewRay(origin, direction Vec3, tm Double) *Ray

func (*Ray) At

func (r *Ray) At(t Double) Vec3

func (*Ray) Color

func (r *Ray) Color(backGround Color, world ObjectList, depth int) Color

type SolidColor

type SolidColor struct {
	Color Color
}

SolidColor

func NewSolidColor

func NewSolidColor(rgb Color) *SolidColor

type Texture

type Texture interface {
	// contains filtered or unexported methods
}

type Translate

type Translate struct {
	// contains filtered or unexported fields
}

func NewTranslate

func NewTranslate(obj Object, offset Vec3) *Translate

type TurbulanceNoiseTexture

type TurbulanceNoiseTexture struct {
	// contains filtered or unexported fields
}

TurbulanceNoise (marble)

func NewTurbulanceNoiseTexture

func NewTurbulanceNoiseTexture(scale Double, period Double) *TurbulanceNoiseTexture

type Vec3

type Vec3 struct {
	// contains filtered or unexported fields
}

func NewVec3

func NewVec3(x, y, z Double) Vec3

func NewVec3Random

func NewVec3Random(min, max Double) Vec3

func (Vec3) Add

func (v Vec3) Add(x Vec3) Vec3

func (Vec3) Length

func (v Vec3) Length() Double

func (Vec3) Sub

func (v Vec3) Sub(x Vec3) Vec3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL