packages feed

not-gloss 0.4.0 → 0.4.1

raw patch · 2 files changed

+18/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Vis: VisLine' :: [(Xyz a, Color)] -> VisObject a
+ Vis.VisObject: VisLine' :: [(Xyz a, Color)] -> VisObject a

Files

Vis/VisObject.hs view
@@ -26,6 +26,7 @@                  | VisEllipsoid (a,a,a) (Xyz a) (Quat a) Flavour Gloss.Color                  | VisSphere a (Xyz a) Flavour Gloss.Color                  | VisLine [Xyz a] Gloss.Color+                 | VisLine' [(Xyz a,Gloss.Color)]                  | VisArrow (a,a) (Xyz a) (Xyz a) Gloss.Color                  | VisAxes (a,a) (Xyz a) (Quat a)                  | VisPlane (Xyz a) a Gloss.Color Gloss.Color@@ -42,6 +43,7 @@   fmap f (VisSphere s xyz flav col) = VisSphere (f s) (fmap f xyz) flav col   fmap f (VisEllipsoid (sx,sy,sz) xyz quat flav col) = VisEllipsoid (f sx, f sy, f sz) (fmap f xyz) (fmap f quat) flav col   fmap f (VisLine xyzs col) = VisLine (map (fmap f) xyzs) col+  fmap f (VisLine' xyzcs) = VisLine' $ map (\(xyz,col) -> (fmap f xyz, col)) xyzcs   fmap f (VisArrow (x,y) xyz0 xyz1 col) = VisArrow (f x, f y) (fmap f xyz0) (fmap f xyz1) col   fmap f (VisAxes (x,y) xyz quat) = VisAxes (f x, f y) (fmap f xyz) (fmap f quat)   fmap f (VisPlane xyz x col0 col1) = VisPlane (fmap f xyz) (f x) col0 col1@@ -171,6 +173,21 @@     lighting $= Disabled     setColor col     renderPrimitive LineStrip $ mapM_ (\(Xyz x' y' z') -> vertex$Vertex3 x' y' z') path+    lighting $= Enabled++-- line where you set the color at each vertex+drawObject (VisLine' pathcols) =+  preservingMatrix $ do+    lighting $= Disabled+    +    glBegin gl_LINE_STRIP+    let f (xyz, col) = do+          let Xyz x y z = fmap realToFrac xyz+          setMaterialDiffuse col+          setColor col+          glVertex3f x y z+    mapM_ f pathcols+    glEnd     lighting $= Enabled  -- plane
not-gloss.cabal view
@@ -1,5 +1,5 @@ name:                not-gloss-version:             0.4.0+version:             0.4.1 stability:           Experimental synopsis:            Painless 3D graphics, no affiliation with gloss description:{