From 92ff6034d413727dcbfe3e6e5f77fd8c8c015da2 Mon Sep 17 00:00:00 2001 From: sumi Date: Sun, 11 Jan 2026 23:31:25 -0600 Subject: [PATCH] automated snapshot --- blinds.go | 12 ++++++------ main.go | 16 +++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/blinds.go b/blinds.go index e489881..15541b0 100644 --- a/blinds.go +++ b/blinds.go @@ -21,21 +21,21 @@ func (l *BlindsLayer) Draw(env *Env, g *sg.Graphics) { g.BeginAdditiveBlend() - rowHeight := float32(10.0) - rows := int32(g.Bounds.Height / rowHeight) + rows := 200 + rowHeight := g.Bounds.Height / float32(rows) g.Clear() - c := rl.White - c.A = 100 - g.SetStrokeColor(c) g.SetStrokeWeight(1.0) y := float32(10.0) for range rows { for x := 10; x < int(g.Width()) - 10; x++ { 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 } b := sg.Point { X: float32(x), Y: float32(y) + strokeHeight / 2.0 } g.DrawLine(a, b) diff --git a/main.go b/main.go index 9b480ca..526b454 100644 --- a/main.go +++ b/main.go @@ -106,28 +106,26 @@ func main() { colorCycle := sg.NewFixedColorCycle(sg.FlourescentColors).Shuffle(0) rng := rand.New(rand.NewSource(env.Time.Unix())) - //imageField := NewImageField("/home/d/Dropbox/art/data/david.png") - noiseField := &SimplexNoiseField{Noise: opensimplex.New32(env.Time.Unix())} + imageField := NewImageField("/home/d/Dropbox/art/data/david.png") + noiseField := &SimplexNoiseField{Noise: opensimplex.NewNormalized32(env.Time.Unix())} //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/andromeda.jpg") //imageField := NewImageField("/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{ x: -float32(env.Offscreen.Bounds.Width / 2.0), y: -float32(env.Offscreen.Bounds.Height / 2.0), field: &AdderField{ fields: []Field{ - //&ScaleField{scale: 3, field: imageField}, - &ScaleField{scale: 250, field: noiseField}, + &ScaleField{scale: 3, field: imageField}, + &ScaleField{scale: 500, field: noiseField}, }, }, } - */ //sierpinskiLayer := &SierpinskiArrow { dirty: true } @@ -138,15 +136,15 @@ func main() { sketch.AddColorLayer("background-blue", rl.Blue) sketch.AddColorLayer("background-black", rl.Black) + sketch.AddLayer("blinds", NewBlindsLayer(field)) //sketch.AddLayer("moses", imageLayer) 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 } 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("blinds", NewBlindsLayer(field)) //sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer) // aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg") // sketch.AddLayer("aurora", aurora)