camera

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

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	HSize       float64 //in pixels
	VSize       float64
	FieldOfView float64
	Transform   *matrix.Matrix
	PixelSize   float64
	HalfHeight  float64
	HalfWidth   float64
}

Camera represents a camera

func New

func New(hSize float64, vSize float64, fieldOfView float64) Camera

New returns a new camera

func (*Camera) RayForPixel

func (c *Camera) RayForPixel(x, y int) *ray.Ray

RayForPixel returns the ray from the camera to point (x,y) on canvas

func (Camera) Render

func (c Camera) Render(w world.World) *canvas.Canvas

Render renders the world with a camera

Jump to

Keyboard shortcuts

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