scene

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix [16]float32

func Identity

func Identity() (matrix Matrix)

func Multiply

func Multiply(left, right Matrix) (matrix Matrix)

func Perspective

func Perspective(aspect, fieldOfView, near, far float64) (matrix Matrix)

func RotationX

func RotationX(angle float64) (matrix Matrix)

func RotationY

func RotationY(angle float64) (matrix Matrix)

func RotationZ

func RotationZ(angle float64) (matrix Matrix)

func Scale

func Scale(x, y, z float64) (matrix Matrix)

func Translation

func Translation(x, y, z float64) (matrix Matrix)

type OrbitCamera

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

func NewOrbitCamera

func NewOrbitCamera(canvas *wasmdraw.CanvasElement) (camera *OrbitCamera)

NewOrbitCamera creates a drag-controlled camera with idle rotation.

func (*OrbitCamera) Matrix

func (c *OrbitCamera) Matrix(dt, width, height, distance float64) (matrix Matrix)

Matrix returns the current perspective-view transform.

func (*OrbitCamera) WithIdleRotation

func (c *OrbitCamera) WithIdleRotation(enabled bool) (camera *OrbitCamera)

WithIdleRotation controls automatic camera orbit while the mouse is released.

Jump to

Keyboard shortcuts

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