raytrace

package
v0.0.0-...-c743823 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color struct {
	R, G, B float64
}

func Avg

func Avg(colors ...*Color) *Color

func Radiate

func Radiate(colors ...*Color) *Color

func Reflect

func Reflect(colors ...*Color) *Color

func (*Color) Scale

func (c *Color) Scale(scale float64) *Color

type Context

type Context struct {
	*Intersection
}

type Intersection

type Intersection struct {
	Ray line.Line
	*RenderMesh
	*triangle.Triangle
	PolygonIndex, TriangleIndex int
	T                           float64
}

type Material

type Material struct {
	Color      *Color
	Luminous   float64
	Reflective float64
	Diffuse    angle.Rad
}

type RenderMesh

type RenderMesh struct {
	Original *mesh.TriangleMesh
	Space    []d3.Pt
	Shader
}

type Scene

type Scene struct {
	scene.Camera
	Background Shader
	Depth      int
	RayMult    int
}

func (*Scene) NewFrame

func (s *Scene) NewFrame(meshes int) *SceneFrame

type SceneFrame

type SceneFrame struct {
	scene.Camera
	*Scene
	Meshes []*RenderMesh
}

func (*SceneFrame) Add

func (sf *SceneFrame) Add(m *mesh.TriangleMesh, space *d3.T, shader Shader)

func (*SceneFrame) Image

func (sf *SceneFrame) Image() *image.RGBA

type Shader

type Shader func(*Context) *Material

Jump to

Keyboard shortcuts

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