diff --git a/field.go b/field.go index 9b9743a..06eb0e2 100644 --- a/field.go +++ b/field.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "math" rl "github.com/gen2brain/raylib-go/raylib" "github.com/ojrac/opensimplex-go" ) @@ -123,3 +124,9 @@ func (fl *FieldLayer) IsDirty() bool { return fl.dirty } + +type SinXYField struct {} + +func (f *SinXYField) Get(x, y float32) float32 { + return float32(math.Sin(float64(x * y))) +} diff --git a/main.go b/main.go index 50b523b..1953f5c 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( "time" g "github.com/d2fn/sumi/internal/graphics" - "github.com/ojrac/opensimplex-go" + //"github.com/ojrac/opensimplex-go" gui "github.com/gen2brain/raylib-go/raygui" rl "github.com/gen2brain/raylib-go/raylib" @@ -58,7 +58,8 @@ func main() { rng := rand.New(rand.NewSource(0)) //imageField := NewImageField("/home/d/Dropbox/art/data/david.png") - noiseField := &SimplexNoiseField { Noise: opensimplex.New32(0) } + //noiseField := &SimplexNoiseField { Noise: opensimplex.New32(0) } + sinXYField := &SinXYField { } //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") @@ -68,10 +69,11 @@ func main() { x: -float32(sourceWidth / 2.0), y: -float32(sourceHeight / 2.0), field: &ScaleField{ - scale: 100.0, - field: noiseField, + scale: 500.0, + field: sinXYField, }, } + sierpinskiLayer := &SierpinskiArrow { dirty: true } sketch := NewSketch(sourceWidth, sourceHeight)