vertices :: [(Vec 3 Float,Vec 4 Float)] vertices = concat [[v i,v (i+!1.0)] | i <- [(-2)..2]] where v x = (V3 x 0.0 0.0,red) clear = FrameBuffer $ (DepthImage @1 1000, ColorImage @1 navy) -- ... lines = LineCtx 1.0 LastVertex points = PointCtx (ProgramPointSize $ \(_, _) -> 30.0) 1.0 LowerLeft colorFragmentCtx = (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) cubeVertexStream = fetchArrays Point (unzip vertices) mapFragments2 s fs = accumulate colorFragmentCtx (\a -> fs a) s clear rotate' v = (Uniform "MVP" :: Mat 4 4 Float) *. v main = cubeVertexStream -- cube vertices & mapPrimitives (\(p,c) -> (scale 0.5 . rotate' $ v3FToV4F p, c)) & rasterizePrimitives points Smooth -- rasterize `mapFragments2` id & ScreenOut -- draw into screen