camera

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 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,
	c CameraConfig,
) Camera

New creates a new camera from image dimensions and config

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

type CameraConfig added in v0.3.5

type CameraConfig struct {
	VerticalFovDegrees float64
	ApertureSize       float64
	FocusDistance      float64
	LookFrom           geo.Vec3
	LookAt             geo.Vec3
}

CameraConfig contains all needed parameters for constructing a camera

Jump to

Keyboard shortcuts

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