camera

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: BSD-2-Clause 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 {
	NodeDef  core.NodeDef `node:"-"`
	NodeName string       `node:"Name"`

	Type   string             // 'lookat' 'matrix'
	From   param.PointArray   // eye point
	Target param.PointArray   `node:"To"`
	Roll   param.Float32Array // rotation around z axis
	Up     m.Vec3

	U, V, W m.Vec3 `node:"-"` // orthonormal basis

	Aspect float32 `node:",opt"` // aspect ratio
	Fov    float32 `node:",opt"` // field of view (X), Y is calculated from aspect
	Focal  float32 `node:",opt"` // focal length

	WorldToLocal param.MatrixArray `node:",opt"`
	LocalToWorld param.MatrixArray `node:",opt"`

	TanThetaFocal float32 `node:"-"` // = tan(Fov/2)*Focal

	L, R, T, B float32 `node:",opt"`
	Radius     float32 `node:",opt"`
	// contains filtered or unexported fields
}

The Camera node represents a 3D camera, it can be specified as a 'lookat' or matrix and may have motion keys for its parameters.

func (*Camera) ComputeRay

func (c *Camera) ComputeRay(sc *core.ShaderContext, lensU, lensV float64, ray *core.Ray)

ComputeRay calculates a position and direction for a sampled ray. x,y are the raster position, lensU,lensV are in [0,1)x[0,1)

func (*Camera) Def

func (c *Camera) Def() core.NodeDef

Def is a core.Node method.

func (*Camera) Name

func (c *Camera) Name() string

Name is a core.Node method.

func (*Camera) PostRender

func (c *Camera) PostRender() error

PostRender is a core.Node method.

func (*Camera) PreRender

func (c *Camera) PreRender() error

PreRender is a core.Node method.

Jump to

Keyboard shortcuts

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