Towards working shadows

This commit is contained in:
2021-09-21 10:34:35 +01:00
parent 8854b195cc
commit 07e128bb04
2 changed files with 10 additions and 10 deletions
+6 -5
View File
@@ -22,7 +22,6 @@ import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Fusion.Stream.Monadic as VS
import Control.Monad.Primitive
import Control.Monad
import Data.Bifoldable
--import qualified Data.DList as DL
pokeVerxs
@@ -91,11 +90,13 @@ pokeTopPrismIndex nv iptr ni ioff = do
topPrismEdgeIndices :: Int -> [Int]
topPrismEdgeIndices n = concatMap f [0..n-1]
where
f i =
[ i, (i+2) `mod` n, i+1, (i+4) `mod` n
, i, i+1, (i+4) `mod` n, (i+3) `mod` n
, i+1, (i+5) `mod` n, i, (i+3) `mod` n
f i = map g
[ 0 , 2 , 1 , 4
, 0 , 1 ,-2 , 3
, 1 , 3 ,-1 , 2
]
where
g j = (2 * i + j) `mod` n
topPrismIndices :: Int -> [Int]
topPrismIndices n = concatMap f [1..n-2] -- triangles on top face