begin implement odin
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package mandelbrot
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
MAX_DEPTH :: 50
|
||||
WIDTH :: 420
|
||||
HEIGHT :: 360
|
||||
|
||||
X_MIN :: -2.0
|
||||
X_MAX :: 1.1
|
||||
Y_MIN :: -1.3
|
||||
Y_MAX :: 1.3
|
||||
|
||||
SIZE :: WIDTH * HEIGHT
|
||||
|
||||
Color :: struct {
|
||||
r, g, b: u8,
|
||||
}
|
||||
|
||||
main :: proc() {
|
||||
fmt.println("hello world")
|
||||
img: [SIZE]Color
|
||||
for i in 0 ..< HEIGHT {
|
||||
for j in 0 ..< WIDTH {
|
||||
x := f64(j) / f64(WIDTH) * (X_MAX - X_MIN) + X_MIN
|
||||
y := f64(i) / f64(HEIGHT) * (Y_MAX - Y_MIN) + Y_MIN
|
||||
c := complex(x, y)
|
||||
depth := diverge(c)
|
||||
img[i * WIDTH + j] = color_map(depth)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
diverge :: proc(_: complex128) -> int {
|
||||
unimplemented()
|
||||
}
|
||||
|
||||
color_map :: proc(_: int) -> Color {
|
||||
unimplemented()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user