Pinhole

3D Wireframe Drawing Library for Go
Alternatives To Pinhole
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Pinhole508
3 years ago1January 30, 2021iscGo
3D Wireframe Drawing Library for Go
Awesome Holistic 3d422
3 years ago
A list of papers and resources (data,code,etc) for holistic 3D reconstruction in computer vision
Render Py219
4 years agomitPython
A software 3D renderer written in Python. (Purely educational)
Pinhole Js117
3 months ago2mitJavaScript
3D Wireframe Drawing Library for HTML Canvas
Godot Trail System114
2 years ago5mitGDScript
Advanced trail/ribbon plugin for the Godot Engine
Pygame3d43
7 years ago1Python
Set of modules that use Pygame to display 3D graphics
Ray441
6 months ago2mitPostScript
Ray4 is a 4D raytracer original developed for my 1991 master's thesis in computer science
Gles2_sample_android30
7 years agoapache-2.0Java
Sample Android app demonstrating OpenGL-ES 2.0 shader programs
Thebes.jl29
7 months ago5otherJulia
Thebes.jl is a simple little package that provides 3D services to Luxor.jl.
Pywireframerenderer17
4 years agoPython
Pure-python 3D wireframe renderer
Alternatives To Pinhole
Select To Compare


Alternative Project Comparisons
Readme

pinhole

GoDoc

3D Wireframe Drawing Library for Go

Javascript Version
Demo

earthshapes spiralgopher

Why does this exist?

I needed a CPU based 3D rendering library with a very simple API for visualizing data structures. No bells or whistles, just clean lines and solid colors.

Getting Started

Installing

To start using pinhole, install Go and run go get:

$ go get -u github.com/tidwall/pinhole

This will retrieve the library.

Using

The coordinate space has a locked origin of 0,0,0 with the min/max boundaries of -1,-1,-1 to +1,+1,+1. The Z coordinate extends from -1 (nearest) to +1 (farthest).

There are four types of shapes; line, cube, circle, and dot. These can be transformed with the Scale, Rotate, and Translate functions. Multiple shapes can be transformed by nesting in a Begin/End block.

A simple cube:

p := pinhole.New()
p.DrawCube(-0.3, -0.3, -0.3, 0.3, 0.3, 0.3)
p.SavePNG("cube.png", 500, 500, nil)

Rotate the cube:

p := pinhole.New()
p.DrawCube(-0.3, -0.3, -0.3, 0.3, 0.3, 0.3)
p.Rotate(math.Pi/3, math.Pi/6, 0)
p.SavePNG("cube.png", 500, 500, nil)

Add, rotate, and transform a circle:

p := pinhole.New()
p.DrawCube(-0.3, -0.3, -0.3, 0.3, 0.3, 0.3)
p.Rotate(math.Pi/3, math.Pi/6, 0)

p.Begin()
p.DrawCircle(0, 0, 0, 0.2)
p.Rotate(0, math.Pi/2, 0)
p.Translate(-0.6, -0.4, 0)
p.Colorize(color.RGBA{255, 0, 0, 255})
p.End()

p.SavePNG("cube.png", 500, 500, nil)

Contact

Josh Baker @tidwall

License

pinhole source code is available under the ISC License.

Popular Wireframe Projects
Popular 3d Graphics Projects
Popular Graphics Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Go
3d
Graphics
Shape
Wireframe