primitive

package
v0.0.0-...-8074eba Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const BehindCamera = 10e21

BehindCamera is magic

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	P1, P2 Point2D
}

func (Line) Draw

func (l Line) Draw(dst *image.Gray, col byte)

func (Line) DrawAA

func (l Line) DrawAA(dst *image.Gray, col byte)

type P2Ds

type P2Ds []Point2D

type P3Ds

type P3Ds []Point3D

func LoadOBJ

func LoadOBJ(b []byte) (verts P3Ds, edges [][2]int)

LoadOBJ will load and OBJ and return vertices and deduplicated edges.

func (P3Ds) ProjectTo

func (p P3Ds) ProjectTo(dst []Point2D, w, h, zoff float32)

rotateFn returns a function that rotates around (0,0,0). dst must be same size or bigger than p.

func (P3Ds) RotateTo

func (p P3Ds) RotateTo(dst P3Ds, xAn, yAn, zAn float64)

rotateFn returns a function that rotates around (0,0,0). Supply angles in radians. dst must be same size or bigger than p.

func (P3Ds) Scale

func (p P3Ds) Scale(f float32)

type Point2D

type Point2D struct {
	X, Y float32
}

func (Point2D) DistSq

func (p Point2D) DistSq(p2 Point2D) float32

type Point3D

type Point3D struct{ X, Y, Z float32 }

func (*Point3D) Scale

func (c *Point3D) Scale(f float32)

Jump to

Keyboard shortcuts

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