projection

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package projection provides the projection interface and implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOffsetCenter

func GetOffsetCenter(screenWidth, screenHeight int, bounds image.Rectangle) image.Point

GetOffsetCenter returns the offset to move `bounds` to the center of the screen.

func GetScale

func GetScale(screenWidth, screenHeight int, bounds image.Rectangle) int

GetScale returns the scale factor to fit bounds in the given screen size.

Types

type Projection

type Projection interface {
	Project(math3.Vec) math3.Vec

	SetOffset(math3.Vec)

	GetScale() float64
	SetScale(float64)

	GetAngle() math3.Vec
	SetAngle(math3.Vec)
}

Projection defines how to project the given 3d point.

func NewDirect

func NewDirect() Projection

NewDirect creates the default projection without direct changes.

func NewIsomorphic

func NewIsomorphic(scale int) Projection

NewIsomorphic creates an isomorphic projection with the given scale.

Jump to

Keyboard shortcuts

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