Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 29 days 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-11T18:17:55.000Z (2 months ago)
- Last Synced: 2024-09-13T14:09:06.587Z (2 months 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.78 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GoDoc](https://godoc.org/github.com/setanarut/gog/v2?status.svg)](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
![curve_anim](https://github.com/user-attachments/assets/135882e0-5a6d-438c-b0d0-80ebd12713c2)
## Examples
### Path follow animation
```Go
ctx := gog.NewContext(250, 100)
rect := shapes.Rect(vec.Vec2{}, 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)
```![path_follow](https://github.com/user-attachments/assets/55ac6887-41eb-4fb1-8d1c-55e2cdcb93fb)
See folder [examples](./examples) for all examples