automated snapshot
This commit is contained in:
12
blinds.go
12
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)
|
||||
|
||||
16
main.go
16
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)
|
||||
|
||||
Reference in New Issue
Block a user