https://github.com/setanarut/gog
Object-oriented 2d drawing package for Go language
https://github.com/setanarut/gog
2d-graphics animation apng apng-animation creative-coding draw drawing generative-art go golang-library golang-package procedural-generation rasterizer
Last synced: about 1 year ago
JSON representation
Object-oriented 2d drawing package for Go language
- Host: GitHub
- URL: https://github.com/setanarut/gog
- Owner: setanarut
- License: bsd-3-clause
- Created: 2023-10-10T17:29:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T00:59:52.000Z (about 1 year ago)
- Last Synced: 2025-04-29T09:56:39.045Z (about 1 year ago)
- Topics: 2d-graphics, animation, apng, apng-animation, creative-coding, draw, drawing, generative-art, go, golang-library, golang-package, procedural-generation, rasterizer
- Language: Go
- Homepage:
- Size: 1.79 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/setanarut/gog/v2)
# GOG v2
GOG is a Go Object-oriented 2d drawing library for creative coding and generative art

## Examples
### Path follow animation
```Go
ctx := gog.NewContext(250, 100)
rect := shapes.Rect(v.Vec{}, 30, 10)
lemn := shapes.Lemniscate(100, 100).SetPos(ctx.Center)
lemnTotalLength := lemn.Length()
for _, length := range utils.Linspace(0, lemnTotalLength, 120) {
ctx.Clear(color.Black)
ctx.Stroke(lemn, gog.DefaultStrokeStyle())
pos, ang := lemn.PointAngleAtLength(length)
ctx.Fill(rect.SetPos(pos).Rotated(ang), color.White)
ctx.AppendAnimationFrame()
}
ctx.SaveAPNG("path_follow.png", 2)
```

See folder [examples](./examples) for all examples