Skip to content

Instantly share code, notes, and snippets.

@seanesss
Created July 10, 2011 03:37
Show Gist options
  • Select an option

  • Save seanesss/1074229 to your computer and use it in GitHub Desktop.

Select an option

Save seanesss/1074229 to your computer and use it in GitHub Desktop.
Code for PlaySpace
effect = surfBProg eyePosE test
a0 :: T -> SurfD
a0 _ = hfSurf 1
simple3 :: SurfD -> FullSurf
simple3 surf = (lighter,view,surf,img)
where
lighter = basicStd
view = view1
img = toColor . img3 . surf . p2T2
img3 = checker3 . (2 *^)
p2T2 (u :+ v) = pureD u :+ pureD v
checker3 :: V3 T -> BoolE
checker3 (a,b,c) = (f a /=* f b) /=* f c
where f = (>* 0.5) . frac . powVal
test :: SurfB
test = simple3 . a0
eyePos :: EyePos
eyePos = (0, 0.75, 2.5) -- tweak
eyePosE :: EyePosE
eyePosE = pureE (V.vec3 ex ey ez) where (ex,ey,ez) = eyePos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment