• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Go
  • Created almost 5 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Creative coding in Go

GoDoc

Ink is a framework for creative 2D graphics in Go, based on OpenGL. Visit buchanae.github.io/ink for more.

Example: a simple triangle

Install:

go get github.com/buchanae/ink

(Building Ink is a little tricky, because it depends on GLFW. You might need to install these packages:

build-essential
xorg-dev 

Write example.go:

package main

import (
	. "github.com/buchanae/ink/color"
	. "github.com/buchanae/ink/dd"
	"github.com/buchanae/ink/gfx"
)

func Ink(doc gfx.Doc) {
	t := Triangle{
		XY{0.2, 0.2},
		XY{0.8, 0.2},
		XY{0.5, 0.8},
	}
	s := gfx.Fill{Shape: t}.Shader()
	s.Set("a_color", []RGBA{
		Red, Green, Blue,
	})
	s.Draw(doc)
}

Run:

ink example.go

Ink opens a window and renders your triangle:

Triangle example

There are more examples in the sketches directory.

Implementation Notes

  • Ink is based on OpenGL only, although other backends are desired. There is an experimental WebGL branch.
  • Ink is focused on 2D graphics, although 3D is desired some day.
  • Most numbers are float32, because OpenGL APIs are mostly based on float32s.
    • This is also why I haven't used the Go stdlib image/color. I admit this feels messy.
  • Angles are in radians, unless otherwise noted.

More Repositories

1

github-release-notes

Generate release notes content from GitHub Pull Request history.
Go
57
star
2

basket

An email list subscription service
Python
7
star
3

cwl

common workflow language library and runtime
Go
7
star
4

cli

CLI generator and utils for Golang.
Go
5
star
5

tree

Drawing a tree on HTML canvas
JavaScript
2
star
6

pop

Collection of bioinformatics tools, written in Go.
Go
2
star
7

annotation

Genome annotation models
Python
2
star
8

go-code-reload

Example of code reloading issues in Go.
Go
2
star
9

basket-lib

vendor library for basket
Python
2
star
10

ktl

Go
1
star
11

tugboat

Toolkit for running batch tasks.
Go
1
star
12

word-crosser

Experiments in crossing words
Python
1
star
13

bam-to-splat

C++
1
star
14

summit-buddy-emailer

Script for sending a summit buddy email to CSV list of recipients.
Python
1
star
15

warren

C++
1
star
16

eabuc

http://eabuc.com
Go
1
star
17

curator

JavaScript
1
star
18

duncan

A C++ library for reading files in GFF3 format.
C++
1
star
19

odetta

Tools for filtering paired-end Splat alignments
Python
1
star
20

dotfiles

Vim Script
1
star
21

gff

A parser for GFF3-formatted files.
Python
1
star
22

Zeus-Platform-Header

Adds a platform header to a request, using Zeus Trafficscript.
1
star
23

iso-signal

Analyzing isoform coverage
C++
1
star
24

gew

Grass, Elk, and Wolves
JavaScript
1
star
25

bobby

Combining paired-end alignments from bowtie and supersplat, in BAM format.
C++
1
star
26

stats

A small utility for one-pass, parallel calculation of variance.
Python
1
star
27

recycle

Reusable iterators in python
Python
1
star
28

alignment-utils

C++
1
star
29

alfred

JavaScript
1
star
30

abuchanan.github.com-src

The source generating abuchanan.github.com
JavaScript
1
star
31

fastq_to_fasta

C++
1
star
32

tanker

Standalone transfer agent for Git LFS for object storage (Swift, S3, Google Cloud, etc)
Go
1
star
33

bev

A small utility to help me track the command-line work I do.
Python
1
star
34

Uploads

R
1
star
35

illumina-barcode-balancer

A collection of bioinformatics programs I've written.
Python
1
star
36

kegg-matching

Python
1
star