camera

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Overview

Package camera provides a camera used by raytracer to shoot rays into the scene

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

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

Camera contains all data needed to describe a cameras position, field of view and where it is pointing

func New

func New(
	imageWidth int,
	imageHeight int,
	verticalFovDegrees float64,
	aperture float64,
	focusDistance float64,
	lookFrom geo.Vec3,
	lookAt geo.Vec3,
	vup geo.Vec3,
) Camera

New creates a new camera with more easy to understand parameters

func (Camera) GetRay

func (c Camera) GetRay(u float64, v float64) geo.Ray

GetRay is a function for generating a ray for a certain u/v for the raytraced image

Jump to

Keyboard shortcuts

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