This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- drawPoint : returns a pixel (size 2 square) Form | |
of color 'val' at position (x,y) -} | |
drawPoint : (Int,Int, Float) -> Form | |
drawPoint (x,y,val) = | |
square 2 | |
|> filled (Color.greyscale (1-val)) | |
|> move (toFloat x,toFloat y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- drawPoint : returns a pixel (size 2 square) Form | |
of color 'val' at position (x,y) -} | |
drawPoint : (Int,Int, Float) -> Form | |
drawPoint (x,y,val) = | |
square 2 | |
|> filled (Color.greyscale (1-val)) | |
|> move (toFloat x,toFloat y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
add : Vec3 -> Vec3 -> Vec3 | |
add (x,y,z) (u,v,w) = (x+u,y+v,z+w) | |
mul : Float -> Vec3 -> Vec3 | |
mul a (x,y,z) = (a*x,a*y,a*z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
add : Vec3 -> Vec3 -> Vec3 | |
add (x,y,z) (u,v,w) = (x+u,y+v,z+w) | |
mul : Float -> Vec3 -> Vec3 | |
mul a (x,y,z) = (a*x,a*y,a*z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
add : Vec3 -> Vec3 -> Vec3 | |
add (x,y,z) (u,v,w) = (x+u,y+v,z+w) | |
mul : Float -> Vec3 -> Vec3 | |
mul a (x,y,z) = (a*x,a*y,a*z) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
i : Vec3 | |
i = (1,0,0) | |
j : Vec3 | |
j = (0,1,0) | |
k : Vec3 | |
k = (0,0,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
i : Vec3 | |
i = (1,0,0) | |
j : Vec3 | |
j = (0,1,0) | |
k : Vec3 | |
k = (0,0,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vector where | |
type Vec3 = (Float, Float, Float) | |
add : Vec3 -> Vec3 -> Vec3 | |
add (x,y,z) (u,v,w) = (x+u,y+v,z+w) | |
mul : Float -> Vec3 -> Vec3 | |
mul a (x,y,z) = (a*x,a*y,a*z) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- Screen paremeters | |
width = 800 | |
height = 600 | |
---- main collage | |
main = collage width height (screen width height) |
OlderNewer