scene

package
v0.0.0-...-cec5250 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2017 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scene

type Scene struct {
	Camera camera.PinHole        `json:"camera"`
	Shapes []shape.Shape         `json:"shapes"`
	Lights []lighting.PointLight `json:"lights"`
}

Scene defines a 3D scene that holds volumetric shapes

func LoadSceneFile

func LoadSceneFile(path string) *Scene

LoadSceneFile loads a scene file to a scene object

func New

func New() *Scene

New creates a new empty scene with a default pinhole camera

func (*Scene) AddLight

func (s *Scene) AddLight(aLightsource lighting.PointLight)

AddLight adds a light to the scene.

func (*Scene) AddShape

func (s *Scene) AddShape(aShape shape.Shape)

AddShape adds a shape to the scene.

func (*Scene) Elements

func (s *Scene) Elements() int

Elements returns the number of elements in the scene

func (*Scene) SaveSceneFile

func (s *Scene) SaveSceneFile(path string)

SaveSceneFile saves the scene as a file that can be loaded later

func (*Scene) TraceScene

func (s *Scene) TraceScene(width, height int) *image.Image

TraceScene traces the scene as it currently is, returning the final image.

Jump to

Keyboard shortcuts

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