automated snapshot
This commit is contained in:
34
main.go
34
main.go
@@ -1,12 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
"math/rand"
|
||||
"os"
|
||||
"time"
|
||||
"flag"
|
||||
|
||||
g "github.com/d2fn/sumi/internal/graphics"
|
||||
|
||||
@@ -92,7 +93,7 @@ func main() {
|
||||
//NewColor(11, 35, 176, 50),
|
||||
|
||||
//r
|
||||
contourLayer := NewContourLayer(&sketch, rng, field, actorColor)
|
||||
contourLayer := NewContourLayer(&sketch, rng, field, actorColor, -math.Pi, math.Pi)
|
||||
sketch.AddLayer("contours", contourLayer)
|
||||
sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer)
|
||||
// aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg")
|
||||
@@ -246,32 +247,3 @@ func main() {
|
||||
rl.CloseWindow()
|
||||
}
|
||||
|
||||
type FieldLayer struct {
|
||||
field Field
|
||||
loColor rl.Color
|
||||
hiColor rl.Color
|
||||
dirty bool
|
||||
}
|
||||
|
||||
func (fl *FieldLayer) Update(ctx *RenderCtx) {
|
||||
;
|
||||
}
|
||||
|
||||
func (fl *FieldLayer) Draw(ctx *RenderCtx) {
|
||||
rl.ClearBackground(rl.Blank)
|
||||
rl.BeginBlendMode(rl.BlendAlphaPremultiply)
|
||||
for x := range ctx.SourceWidth {
|
||||
for y := range ctx.SourceHeight {
|
||||
v := fl.field.Get(float32(x), float32(y))
|
||||
clr := LerpCurve(v, 1.3, fl.loColor, fl.hiColor)
|
||||
rl.DrawPixel(x, y, clr)
|
||||
}
|
||||
}
|
||||
rl.EndBlendMode()
|
||||
fl.dirty = false
|
||||
}
|
||||
|
||||
func (fl *FieldLayer) IsDirty() bool {
|
||||
return fl.dirty
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user