automated snapshot

This commit is contained in:
sumi
2026-01-11 23:31:25 -06:00
parent 0efb08c1af
commit 92ff6034d4
2 changed files with 13 additions and 15 deletions

View File

@@ -21,21 +21,21 @@ func (l *BlindsLayer) Draw(env *Env, g *sg.Graphics) {
g.BeginAdditiveBlend() g.BeginAdditiveBlend()
rowHeight := float32(10.0) rows := 200
rows := int32(g.Bounds.Height / rowHeight) rowHeight := g.Bounds.Height / float32(rows)
g.Clear() g.Clear()
c := rl.White
c.A = 100
g.SetStrokeColor(c)
g.SetStrokeWeight(1.0) g.SetStrokeWeight(1.0)
y := float32(10.0) y := float32(10.0)
for range rows { for range rows {
for x := 10; x < int(g.Width()) - 10; x++ { for x := 10; x < int(g.Width()) - 10; x++ {
fieldValue := l.Field.Get(float32(x), float32(y)) fieldValue := l.Field.Get(float32(x), float32(y))
strokeHeight := rl.Remap(fieldValue, 0.0, 1.0, 0.0, rowHeight * 1.3) c := rl.White
c.A = uint8(rl.Remap(fieldValue, 0.0, 1.0, 10, 75))
g.SetStrokeColor(c)
strokeHeight := rl.Remap(fieldValue, 0.0, 1.0, 0, rowHeight * 10.0)
a := sg.Point { X: float32(x), Y: float32(y) - strokeHeight / 2.0 } a := sg.Point { X: float32(x), Y: float32(y) - strokeHeight / 2.0 }
b := sg.Point { X: float32(x), Y: float32(y) + strokeHeight / 2.0 } b := sg.Point { X: float32(x), Y: float32(y) + strokeHeight / 2.0 }
g.DrawLine(a, b) g.DrawLine(a, b)

16
main.go
View File

@@ -106,28 +106,26 @@ func main() {
colorCycle := sg.NewFixedColorCycle(sg.FlourescentColors).Shuffle(0) colorCycle := sg.NewFixedColorCycle(sg.FlourescentColors).Shuffle(0)
rng := rand.New(rand.NewSource(env.Time.Unix())) rng := rand.New(rand.NewSource(env.Time.Unix()))
//imageField := NewImageField("/home/d/Dropbox/art/data/david.png") imageField := NewImageField("/home/d/Dropbox/art/data/david.png")
noiseField := &SimplexNoiseField{Noise: opensimplex.New32(env.Time.Unix())} noiseField := &SimplexNoiseField{Noise: opensimplex.NewNormalized32(env.Time.Unix())}
//imageField := NewImageField("/home/d/Dropbox/art/data/ramstatue.png") //imageField := NewImageField("/home/d/Dropbox/art/data/ramstatue.png")
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/Photo Dec 24 2025, 5 58 23 PM.jpg") //imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/Photo Dec 24 2025, 5 58 23 PM.jpg")
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/andromeda.jpg") //imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/andromeda.jpg")
//imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg") //imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg")
//imageLayer := NewImageLayer("/home/d/Dropbox/art/data/moses_statue.jpg") //imageLayer := NewImageLayer("/home/d/Dropbox/art/data/moses_statue.jpg")
field := &ScaleField { scale: 250, field: noiseField } field :=
/*
&TranslateField{ &TranslateField{
x: -float32(env.Offscreen.Bounds.Width / 2.0), x: -float32(env.Offscreen.Bounds.Width / 2.0),
y: -float32(env.Offscreen.Bounds.Height / 2.0), y: -float32(env.Offscreen.Bounds.Height / 2.0),
field: field:
&AdderField{ &AdderField{
fields: []Field{ fields: []Field{
//&ScaleField{scale: 3, field: imageField}, &ScaleField{scale: 3, field: imageField},
&ScaleField{scale: 250, field: noiseField}, &ScaleField{scale: 500, field: noiseField},
}, },
}, },
} }
*/
//sierpinskiLayer := &SierpinskiArrow { dirty: true } //sierpinskiLayer := &SierpinskiArrow { dirty: true }
@@ -138,15 +136,15 @@ func main() {
sketch.AddColorLayer("background-blue", rl.Blue) sketch.AddColorLayer("background-blue", rl.Blue)
sketch.AddColorLayer("background-black", rl.Black) sketch.AddColorLayer("background-black", rl.Black)
sketch.AddLayer("blinds", NewBlindsLayer(field))
//sketch.AddLayer("moses", imageLayer) //sketch.AddLayer("moses", imageLayer)
sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: fieldColor, dirty: true}) sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: fieldColor, dirty: true})
actorColor := color.RGBA { R: 10, G: 58, B: 59, A: 25 } actorColor := color.RGBA { R: 10, G: 58, B: 59, A: 25 }
fmt.Printf("actor color = %v\n", actorColor) fmt.Printf("actor color = %v\n", actorColor)
contourLayer := NewContourLayer(rng, field, actorColor, -12*math.Pi, 12*math.Pi) contourLayer := NewContourLayer(rng, field, actorColor, -math.Pi, math.Pi)
sketch.AddLayer("contours", contourLayer) sketch.AddLayer("contours", contourLayer)
sketch.AddLayer("blinds", NewBlindsLayer(field))
//sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer) //sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer)
// aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg") // aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg")
// sketch.AddLayer("aurora", aurora) // sketch.AddLayer("aurora", aurora)