packages feed

HRay (empty) → 1.1

raw patch · 31 files changed

+2446/−0 lines, 31 filesdep +arraydep +basedep +directorysetup-changed

Dependencies added: array, base, directory, gtk

Files

+ HRay.cabal view
@@ -0,0 +1,39 @@+name:                HRay+version:             1.1+synopsis:            Haskell raytracer+description:         HRay is a ray tracing application written in Haskell as part of my+                     thesis at Ghent University. It's quite simple for now, but I'll probably+                     keep on working on it in the near future.+                     .+                     For more information, see the homepage or the Haskell wiki entry:+                     <http://haskell.org/haskellwiki/HRay>.+category:            Graphics+license:             BSD3+license-file:        LICENSE+author:              boegel+maintainer:          boegel <kenneth [dot] hoste [at] elis [dot] ugent [dot] be>+homepage:            http://trappist.elis.ugent.be/~kehoste/Haskell/HRay/++build-depends:       base>3, array, directory, gtk >= 0.9.7+build-type:          Simple+data-files:          readme.txt,+                     -- and some files to experiment with+                     scenes/shadow2.hry, scenes/perlinShowFire.hry,+                     scenes/shadow0.hry, scenes/perlinShowSemiTurb.hry,+                     scenes/perlinShowTurb.hry, scenes/mirror.hry,+                     scenes/shadow1.hry, scenes/perlin0.hry,+                     scenes/perlin1.hry, scenes/trans2.hry,+                     scenes/perlinShowSolid.hry, scenes/circles.hry,+                     scenes/trans1.hry, scenes/perlinShowMarble.hry,+                     scenes/trans0.hry, scenes/perlinShowMarbleBase.hry,+                     scenes/perlinShowWood.hry, scenes/perlinShowPlasma.hry+extra-source-files:  HRayGUI.lhs+tested-with:         GHC==6.8.2++executable:          HRay+main-is:             HRayMain.lhs+other-modules:       HRayEngine, HRayOutput, PixBufExtras,+                     HRayMath, HRayPerlin, HRayParser++ghc-options:         -Wall+ghc-prof-options:    -prof -auto-all
+ HRayEngine.lhs view
@@ -0,0 +1,193 @@+	module HRayEngine, which contains the functions needed to raytrace a scene+	intended for usage with the other modules in the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	==========================================================================++> module HRayEngine (Resolution, Color, Diff(Solid,Perlin), Texture(Texture), TexturedObject,+>		     Light(AmbientLight,PointLight), Scene(Scene), Camera(Camera), rayTrace) where++> import Data.Maybe+> import HRayMath+++        representation of a color++> type Color = (Double,Double,Double)++        representation of the diffuse component of a material: solid or perlin noise++> data Diff = Solid Color |+>             Perlin (Point3D -> Color)++        representation of a material++> data Texture = Texture Diff Double Int Double Double++        representation of an object++> type TexturedObject = (Object,Texture)++	representation of a light intensity++> type Intensity = (Double,Double,Double)++        representation of a light source++> data Light = PointLight Point3D Intensity+>            | AmbientLight Intensity++        representation of a camera++> data Camera = Camera Point3D Dimension++	representation of a scene++> data Scene = Scene Camera Color [TexturedObject] [Light]++        representation of an intersection++> data Intersection = Intersection Double Ray TexturedObject++        representation of an image++> type Image = Point2D -> Color++	determines the distance between the start point of the ray and the intersection point++> intDist :: (Maybe Intersection) -> Double+> intDist Nothing = 0.0+> intDist (Just (Intersection d _ _)) = d++	determines the texture of the intersected object++> intText :: (Maybe Intersection) -> Texture+> intText Nothing = Texture (Solid (0.0,0.0,0.0)) 0.0 0 0.0 0.0+> intText (Just (Intersection _ _ (_,t))) = t++	determines the color at the intersection point+	- if the texture has a solid color, this color is returned+	- if the texture has a noise function to determine the color,+	  this function is used to determine the color for the given point++> colorAt :: (Maybe Intersection) -> Color+> colorAt Nothing   = (0.0,0.0,0.0)+> colorAt (Just (Intersection _ _ (_,Texture (Solid color) _ _ _ _) )) = color+> colorAt i@(Just (Intersection _ _ (_,Texture (Perlin f) _ _ _ _) )) = f (intPt i)++	determines the normal at the intersection point++> normalAt :: (Maybe Intersection) -> Vector+> normalAt Nothing   = (0.0,0.0,0.0)+> normalAt i@(Just (Intersection _ _ (o,_) )) = normal (intPt i) o++	determines the intersection point of the given intersection++> intPt :: (Maybe Intersection) -> Point3D+> intPt Nothing = (0.0,0.0,0.0)+> intPt (Just (Intersection d (Ray start dir) _)) = start <+> (dir *> d)+++	determines the first positive value in a list++> fstPos :: [Double] -> Double+> fstPos   []   = 0.0+> fstPos (l:ls) = if l > 10**(-6) then l else fstPos ls++        determines the _closest_ intersection of a ray and an object, with a distance bigger then the given distance+        if no intersection (with a distance higher then the given distance) is found, the given intersection is returned,+        else, the new intersection is created and returned+        ! ! ! the list returned by intRayWith should be sorted ! ! !++> closestInt :: Ray -> (Maybe Intersection) -> TexturedObject -> (Maybe Intersection)++> closestInt r i (o,m) = if d > 10**(-6) && ((isNothing i) || d < (intDist i))+>				then Just (Intersection d r (o,m))+>				else i+>    where+>	d = fstPos (intRayWith r o)++	determines the closest intersection of aray and a list of objects++> intersect :: Ray -> [TexturedObject] -> (Maybe Intersection)+> intersect r o = foldl (closestInt r) Nothing o++	determines the diffuse color at the intersection point++> diff :: (Maybe Intersection) -> Light -> Color+> diff _ (AmbientLight _)     = (0.0,0.0,0.0)+> diff i (PointLight pos int) = (int *> ((mkNormVect (intPt i) pos) *. (normalAt i))) <*> (colorAt i)++	determines the specular color at the intersection point++> spec :: (Maybe Intersection) -> Vector -> Light -> Color+> spec _ _ (AmbientLight _)     = (0.0,0.0,0.0)+> spec i d (PointLight pos int) = int *> (reflCoef * ( ((normalAt i) *. h)**(fromIntegral specCoef) ))+>   where+>       h  				  = norm ((d *> (-1)) <+> (mkNormVect (intPt i) pos))+>	(Texture _ reflCoef specCoef _ _) = intText i++        shades the intersection point++> shadePt :: Intersection -> Vector -> [TexturedObject] -> Light -> Color++		if there is an ambient light in the scene (always in front of the list), then use it++> shadePt i d o (AmbientLight int) = int++		illuminate an intersection point with a point light++> shadePt i d o l@(PointLight pos int)+>	-- distance between light point and an object is smaller than distance between light point and shaded intersection+>       -- => shadow -> no color factor added by this light source+>	| s         = (0.0,0.0,0.0)+>	-- no shadow -> color factor added by this light source+>	| otherwise = (diff (Just i) l) <+> (spec (Just i) d l)+>	where+>		s     = not (isNothing i_s) && (intDist i_s) <= dist (intPt (Just i)) pos+>           	i_s = intersect (mkRay (intPt (Just i)) pos) o++        calculates the reflected component at the given intersection point++> reflectPt :: Int -> Intersection -> Vector -> [TexturedObject] -> [Light] -> Color+> reflectPt depth i d = colorPt depth (Ray (intPt (Just i)) (reflectDir d (normalAt (Just i)))) (0.0,0.0,0.0)++        calculates the refracted component at the given intersection point++> refractPt :: Int -> Intersection -> Vector -> Color -> [TexturedObject] -> [Light] -> Color+> refractPt depth i d b = if refractedDir == (0.0,0.0,0.0) then (\x y -> (0.0,0.0,0.0))+>							   else colorPt depth (Ray (intPt (Just i)) refractedDir) (b *> refrCoef)+>   where+>	refractedDir                       = refractDir d (normalAt (Just i)) refrIndex+>	(Texture _ _ _ refrCoef refrIndex) = intText (Just i)+++        determines the color at the given point of the view plane++> colorPt :: Int -> Ray -> Color -> [TexturedObject] -> [Light] -> Color++		when the maximum depth is reached, recursion stops++> colorPt (-1) _ _ _ _ = (0.0, 0.0, 0.0)++> colorPt d r@(Ray _ dir) b o l = if (isNothing i) then b else clip $ shadeColor <+> reflectColor <+> refractColor+>   where+>       shadeColor   = foldl (<+>) (0.0,0.0,0.0) (map (shadePt (fromJust i) dir o) l)+>       reflectColor = if (reflCoef == 0.0) then (0.0, 0.0, 0.0)+>                                          else (reflectPt (d-1) (fromJust i) dir o l) *> reflCoef+>       refractColor = if (refrCoef == 0.0) then (0.0, 0.0, 0.0)+>                                          else (refractPt (d-1) (fromJust i) dir b o l) *> refrCoef+>       i = intersect r o+>	(Texture _ reflCoef _ refrCoef _) = intText i++	determines the color of one ray through a given point++> rayTracePt :: Int -> Scene -> Point3D -> Color+> rayTracePt d (Scene (Camera eye _) b o l) p = colorPt d (Ray p (mkNormVect eye p)) b o l++        raytraces the scene, and returns a list of colors representing the image++> rayTrace :: Int -> Resolution -> Scene -> Image+> rayTrace d r s@(Scene (Camera _ dim) _ _ _) = (rayTracePt d s) . (mapToWin r dim)
+ HRayGUI.lhs view
@@ -0,0 +1,219 @@+	HRay visual main program, built with Gtk2Hs+	intended for usage with the other modules in the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	==========================================================================++> import Graphics.UI.Gtk hiding (Graphics.UI.Gtk.Gdk.Enums.Solid,Graphics.UI.Gtk.General.Structs.Color)+> import Data.IORef (newIORef,readIORef,writeIORef)+> import Data.Array (Array, (!), listArray) +> import Maybe (isNothing)+> import PixBufExtras (pixbufSetPixelsRGB8)+> import HRayEngine (Scene(Scene))+> import HRayOutput (getRenderTime, getImage)+> import HRayParser (RenderDescr(RenderDescr), readDescr)+> import Directory (doesFileExist)+> import System.CPUTime (getCPUTime)++--------------------+| Reading a  scene |+--------------------++> loadThisScene :: String -> IO (Maybe RenderDescr)+> loadThisScene file = do +>                          exists <- doesFileExist file +>                          case exists of+>                               True -> do +>                                    fileContent <- readFile file+>                                    return (Just (readDescr fileContent))+>                               False -> return Nothing ++-------------------------+| Handling click events |+------------------------++  loading a scene++> loadScene :: String -> Label -> Label -> Label -> IO (Maybe RenderDescr)++> loadScene "" messLabel descrLabel renderTimeLabel = do +>   labelSetText messLabel "\nNo scene loaded.\n"+>   labelSetText descrLabel "\nScene description:\n\n Resolution: <none>\n Objects: <none>\n Lights: <none>\n"+>   labelSetText renderTimeLabel "\nRender time:\n\n   <none>\n"+>   return Nothing++> loadScene file messLabel descrLabel renderTimeLabel = do+>   renderDescr <- loadThisScene file+>   labelSetText renderTimeLabel "\nRender time:\n\n   <none>\n"+>   case renderDescr of+>        Nothing -> do +>	    labelSetText messLabel "\nNo such file.\n"+>           labelSetText descrLabel "\nScene description:\n\n Resolution: <none>\n Objects: <none>\n Lights: <none>\n"+>        (Just (RenderDescr (rx,ry) depth (Scene _ _ objects lights)) ) -> do +>           labelSetText messLabel "\nScene loaded.\n"+>           labelSetText descrLabel ("\nScene description:\n\n Resolution: "++(show rx)++"x"+++>				     (show ry)++"\n # Objects: "++(show (length objects))++"\n # Lights: "+++>				     (show (length lights))++"\n")+>   return renderDescr+++  setting up a pixbuf with a Color array+  +> pixbufSetPixelsRGB8FromArray :: Int -> Pixbuf -> Array Int (Int,Int,Int) -> IO()+> pixbufSetPixelsRGB8FromArray w pixbuf arr =+>    pixbufSetPixelsRGB8 pixbuf (\x y -> (\ (r,g,b) -> (fromIntegral r, fromIntegral g, fromIntegral b)) $ arr!(y*w+x) )+++  rendering a scene++> renderScene :: (Maybe RenderDescr) -> Label -> IO Pixbuf++> renderScene (Just (RenderDescr res@(rx,ry) depth scene)) descrLabel = do+>   let colorList   = map (\ (r,g,b) -> (round (r*255),round (g*255),round (b*255))) $ getImage depth res scene+>       colorArray  = listArray (0,rx*ry-1) colorList+>   pixBuf <- pixbufNew ColorspaceRgb False 8 rx ry+>   pixbufSetPixelsRGB8FromArray rx pixBuf colorArray+>   return pixBuf++---------------------------+| Handling closure events |+---------------------------++  returning 'False' results in destroys the window+  (and throws a destroy-event)++> deleteEvent :: Event -> IO Bool+> deleteEvent _ = do return False++  +  what should happen when the window is being closed++> destroyEvent :: IO()+> destroyEvent = do mainQuit++--------------------+| : : : MAIN : : : |+--------------------++> main :: IO()+> main = do +++    initializing GUI++>   initGUI+++    setting up new window++>   window <- windowNew+>   onDelete window deleteEvent+>   onDestroy window destroyEvent+>   windowSetTitle window "HRay - a Haskell raytracer"+++    creating a place to show the rendered image++>   scrollWindow <- scrolledWindowNew Nothing Nothing+>   containerSetBorderWidth scrollWindow 10+>   image <- imageNewFromFile "default.png"+>   scrolledWindowAddWithViewport scrollWindow image+>   widgetSetSizeRequest scrollWindow 800 600+++    creating the control panel++>   controlPanel <- vBoxNew False 2+>   containerSetBorderWidth controlPanel 10+++    setting up the file entry box++>   entry <- entryNew+>   entrySetWidthChars entry 20+++    setting up the load button++>   loadButton <- buttonNewWithLabel "Load scene"+++    setting up the message label++>   messageLabel <- labelNew (Just "\nNo scene loaded.\n")+++    setting up the render button++>   renderButton <- buttonNewWithLabel "Render scene"+++    setting up the scene description label++>   descrLabel <- labelNew (Just "\nScene description:\n\n Resolution: <none>\n Objects: <none>\n Lights: <none>\n")++    setting up the render time label++>   renderTimeLabel <- labelNew (Just "\nRender time:\n\n   <none>\n")+++    preparing scene++>   renderDescrRef <- newIORef Nothing+++    setting click actions++>   onClicked loadButton $ do+>      fileStr <- (entryGetText entry)+>      renderDescr <- loadScene fileStr messageLabel descrLabel renderTimeLabel+>      writeIORef renderDescrRef renderDescr++>   onClicked renderButton $ do+>      renderDescr <- readIORef renderDescrRef+>      let loop = do+>                   n <- eventsPending+>                   if n == 0 then return () else mainIterationDo False >> loop+>      if isNothing renderDescr then +>                                labelSetMarkupWithMnemonic messageLabel "\n<b>Please load a scene.</b>\n"+>                         	else do +>                                timeBefore <- getCPUTime+>                                labelSetMarkupWithMnemonic messageLabel ("\n<span foreground=\"red\">"+++>								          "<b>Rendering scene...</b></span>\n")+>                                loop+>                                pixBuf <- renderScene renderDescr descrLabel+>                                labelSetText messageLabel "\nScene rendered !\n"+>                                imageSetFromPixbuf image pixBuf+>                                timeAfter <- getCPUTime+>                                labelSetText renderTimeLabel $ "\nRender time:\n\n   " ++ +>								(getRenderTime timeBefore timeAfter) ++ "\n"+++    adding everything to the control panel++>   boxPackStart controlPanel entry PackNatural 0+>   boxPackStart controlPanel loadButton PackNatural 0+>   boxPackStart controlPanel messageLabel PackNatural 0+>   boxPackStart controlPanel renderButton PackNatural 0+>   boxPackStart controlPanel descrLabel PackNatural 0+>   boxPackStart controlPanel renderTimeLabel PackNatural 0+++    adding everything to the window++>   hBox <- hBoxNew False 2+>   boxPackStart hBox scrollWindow PackNatural 0+>   boxPackStart hBox controlPanel PackNatural 0+>   containerAdd window hBox+++    packing and showing everything++>   widgetShowAll window+++    wait for events to occure++>   mainGUI
+ HRayMain.lhs view
@@ -0,0 +1,32 @@+		HRay main program, which contains the main function+	intended for usage with the other modules in the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	==========================================================================++> import HRayOutput (getRenderTime, createPPM, getImage)+> import HRayParser (RenderDescr(RenderDescr), readDescr)+> import System.CPUTime (getCPUTime)+> import System.Directory (doesFileExist)+> import System.Environment (getArgs)++        main function++> main :: IO()+> main = do args <- getArgs+>	    if (length args /= 2)+>              then error "Usage: HRay <input scene path> <output ppm path>\n"+>	       else do let input = head args+>	                   output = head (tail args)+>                      exists <- doesFileExist input+>                      case exists of+>                           True -> do fileContent <- readFile input+>                                      let (RenderDescr res depth scene) = readDescr fileContent+>                                      timeBefore <- getCPUTime+>			               writeFile output (createPPM res (getImage depth res scene))+>                                      timeAfter <- getCPUTime+>				       putStr $ "Image output written to " ++ output ++ " in PPM format\n"+>				       putStr $ "Time needed to render the image: " ++ (getRenderTime timeBefore timeAfter) ++ "\n"+>                           False -> error $ "File \"" ++ input ++ "\" does not exist.\n"
+ HRayMath.lhs view
@@ -0,0 +1,177 @@+	module HRayMath, which contains some basic math functions needed in the HRay package+	intended for usage with the other modules in the HRay package, but can be used+	independed from the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	==========================================================================++> module HRayMath where+++        representation of a point in a 2D-space++> type Point2D = (Int,Int)++        representation of a point in a 3D-space++> type Point3D = (Double,Double,Double)++        representation of a 3D-vector++> type Vector = (Double,Double,Double)++        representation of a 2D resolution++> type Resolution = (Int,Int)++        representation of a view window++> type Dimension = (Int,Int)++        representation of the supported object types++> data Object =   Sphere Double Point3D+>               | Plane (Double,Double,Double,Double)++        representation of a ray++> data Ray = Ray Point3D Vector++	function which constructs a ray given the start point and another point on the ray ++> mkRay :: Point3D -> Point3D -> Ray+> mkRay p1 p2 = Ray p1 (mkNormVect p1 p2)++        addition of two tuples++> (<+>) :: (Double,Double,Double) -> (Double,Double,Double) -> (Double,Double,Double)+> (x1,y1,z1) <+> (x2,y2,z2) = (x1+x2, y1+y2, z1+z2)++        subtraction of two tupels++> (<->) :: Point3D -> Point3D -> Vector+> (x1,y1,z1) <-> (x2,y2,z2) = (x1-x2,y1-y2,z1-z2)++	multiplication of two tuples++> (<*>) :: (Double,Double,Double) -> (Double,Double,Double) -> (Double,Double,Double)+> (x1,y1,z1) <*> (x2,y2,z2) = (x1*x2,y1*y2,z1*z2)++	multiplication of a tuple with a factor++> (*>) :: (Double,Double,Double) -> Double -> (Double,Double,Double)+> (x,y,z) *> f = (x*f,y*f,z*f)++	clips a tuple with a max value++> maxF :: Double -> (Double,Double,Double) -> (Double,Double,Double)+> maxF f (x,y,z) = (max x f, max y f, max z f)++	clips a tuple with a min value++> minF :: Double -> (Double,Double,Double) -> (Double,Double,Double)+> minF f (x,y,z) = (min x f, min y f, min z f)++        inner product++> (*.) :: Vector -> Vector -> Double+> (x1,y1,z1) *. (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2++	length of a vector++> len :: Vector -> Double+> len v = sqrt (v *. v)++        normalizes a vector++> norm :: Vector -> Vector+> norm v +>	| len v < 10**(-9) = (0.0,0.0,0.0) +>	| otherwise        = v *> (1/(len v))++        construct a 3D normalised vector, given two 3D points++> mkNormVect :: Point3D -> Point3D -> Vector+> mkNormVect v w = norm (w <-> v)++        function which returns the distance between two points++> dist :: Point3D -> Point3D -> Double+> dist p0 p1 = sqrt ((p1 <-> p0) *. (p1 <-> p0))++        function which clips a color to correct values +	- negative rgb values are casted to 0.0 values+        - positive rgb values higher than 1.0 are casted to 1.0++> clip :: (Double,Double,Double) -> (Double,Double,Double)+> clip = (maxF 0.0) . (minF 1.0)++        function which solves a quadratic equation (ax² + bx + c = 0)++> solveq :: (Double,Double,Double) ->[Double] +> solveq (a,b,c)+>     | (d < 0)   = []+>     | (d > 0)   = [(- b - sqrt d)/(2*a), (- b + sqrt d)/(2*a)]+>     | otherwise = [-b/(2*a)]+>     where+>        d = b*b - 4*a*c++        function which intersects some object with a ray (line) (equation: origin + dir = 0)+        returns a _sorted_ list with the intersection points, or an empty list when there are no intersection points++> intRayWith :: Ray -> Object -> [Double]++        	function which intersects a ray with a sphere (equation: (x-cenA)²+(y-cenB)²+(z-cenC)² = rad²)++> intRayWith (Ray start dir) (Sphere rad cen) = solveq (dir *. dir, 2*(dir *. d), (d *. d) - rad^2)+>    where+>	 d = start <-> cen++	       function which intersects a ray with a plane (equation: Ax + By + Cz + D = 0)+        	where (A,B,C) is the normal on the plane, and D the distance from the origin to the normal if (A,B,C) is normalized+		when normal . dir = 0, the ray and plane are parallel, so there is no intersection++> intRayWith (Ray start dir) (Plane (a,b,c,d)) = if (abs(part) < 10**(-9)) then []  +>                                                                              else [- (d + ((a,b,c) *. start) ) / part]+>   where+>	part = (a,b,c) *. dir++        function which determines the normal at a certain point on some type of object++> normal :: Point3D -> Object -> Vector++	        function which determines the normal at a certain point on a sphere++> normal p (Sphere rad cen) = norm ((p <-> cen) *> (1/rad))++        	function which determines the normal at a certain point on a plane++> normal _ (Plane (a,b,c,d)) = norm (a,b,c)++ 	determines the reflected direction given a certain direction vector and a normal++> reflectDir :: Vector -> Vector -> Vector+> reflectDir i n = i <-> (n *> (2*(n *. i)))++	determines the refracted direction given a certain direction (normalized) vector and a (normalized) normal++> refractDir :: Vector -> Vector -> Double -> Vector+> refractDir i n r = if (v < 0) then (0.0, 0.0, 0.0)+>		     else norm $ (i *> r_c) <+> (n *> (r_c*(abs c) - sqrt v))+>   where+>	c   = n *. (i *> (-1))+>       r_c = if (c < 0) then r else 1/r -- when cosVal < 0, inside of sphere (so travelling to vacuum)+>	v   = 1 + (r_c^2) * (c^2 - 1)++        function which returns a new 2D point for a certain window from a given 2D point and a given resolution+        (used for mapping a raster of pixels onto a view window)++> mapToWin :: Resolution -> Dimension -> Point2D -> Point3D+> mapToWin (rx,ry) (w,h) (px,py) = (x/rxD,y/ryD,0.0)+>   where+>	(rxD,ryD) = (fromIntegral rx, fromIntegral ry)+>	(pxD,pyD) = (fromIntegral px, fromIntegral py)+>	(wD,hD)   = (fromIntegral w, fromIntegral h)+>	(x,y)     = ( (pxD-rxD/2)*wD, (pyD-ryD/2)*hD )
+ HRayOutput.lhs view
@@ -0,0 +1,45 @@+	module HRayOutput, which contains IO related functions+	intended for usage with the other modules in the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	==========================================================================++> module HRayOutput (getRenderTime, createPPM, getImage) where++> import HRayEngine (Resolution, Color, Scene, rayTrace)+++	determines the render time given the start and end cpu time ++> getRenderTime :: Integer -> Integer -> String+> getRenderTime before after = (show min) ++ "m" ++ secStr ++ "s"+>   where+>       total  = div (after - before) (10^12)+>       sec    = mod total 60+>       secStr = if (sec < 10) then "0" ++ (show sec) else show sec+>       min    = div total 60++	determines the array of colors representing an image++> getImage :: Int -> Resolution -> Scene -> [Color]+> getImage d r@(rx,ry) s = [image (fromIntegral x,fromIntegral (-y)) | y <- [-(ry-1)..0], x <- [0..(rx-1)]]+>   where+>	image = rayTrace d r s++        transforms a list of colors into a portable pixmap (PPM) file++> createPPM :: Resolution -> [Color] -> String+> createPPM (w,h) colors = ("P3\n"++) . shows w . (' ':) . shows h . ("\n255\n"++) +>			           . stringify colors $ ""+>                 where stringify = flip $ foldr showC+>                       showC (r,g,b) = shows (round (r*255)) . (' ':) . shows (round (g*255)) +>					. (' ':) . shows (round (b*255)) . (' ':)++++	possible speed up: working without the use of string+	but using hPutBuf (System.IO) instead+	documentation on Ptr: http://www.cse.unsw.edu.au/~chak/haskell/ffi+	
+ HRayParser.y view
@@ -0,0 +1,208 @@+{+{-+     module HRayParser, which contains a parser which allows to use files containing scene descriptions+     intended for usage with the other modules in the HRay package++     author: Kenneth Hoste, 2004-2005+     part of a masters thesis at the University of Ghent, Belgium+-}++module HRayParser (RenderDescr(RenderDescr), readDescr) where++import HRayEngine (Scene(Scene), Texture(Texture), Diff(Solid,Perlin), TexturedObject,+		   Light(AmbientLight, PointLight), Camera(Camera))+import HRayPerlin (perlinSolid, perlinSemiTurbulence,perlinTurbulence,perlinFire,perlinPlasma,perlinMarble,+		   perlinMarbleBase,perlinWood)+import HRayMath (Dimension, Resolution, Object(Sphere,Plane))+import Data.Char (isSpace, isAlpha, isDigit)++  }+%name parseScene+%tokentype { Token }++%token+      int              { TokenInt $$ }+      double           { TokenDouble $$ }+      camera           { TokenCamera }+      background       { TokenBackground }+      diff             { TokenDiff }+      solid            { TokenSolid }+      perlinSolid      { TokenPerlinSolid }+      perlinSemiTurb   { TokenPerlinSemiTurb }+      perlinTurb       { TokenPerlinTurb }+      perlinFire       { TokenPerlinFire }+      perlinPlasma     { TokenPerlinPlasma }+      perlinMarble     { TokenPerlinMarble }+      perlinMarbleBase { TokenPerlinMarbleBase }+      perlinWood       { TokenPerlinWood }+      perlin           { TokenPerlin }+      texture          { TokenTexture }+      sphere           { TokenSphere }+      plane            { TokenPlane }+      object           { TokenTexturedObject }+      objects          { TokenObjects }+      pointLight       { TokenPointLight }+      ambientLight     { TokenAmbientLight }+      lights           { TokenLights }+      scene            { TokenScene }+      resolution       { TokenResolution }+      renderDescr      { TokenRenderDescr }+      '{'              { TokenOpenAcc }+      '}'              { TokenCloseAcc }+      '('              { TokenOpenBrack }+      ')'              { TokenCloseBrack }+      '['              { TokenOpenHook }+      ']'              { TokenCloseHook }+      ','              { TokenComma }++%%++RenderDescr : renderDescr Resolution int '[' Scene ']'                         { RenderDescr $2 $3 $5}++Resolution  : '(' resolution '(' int ',' int ')' ')'                           { ($4,$6) }++Scene       : scene '{' Camera '}' '{' Background '}'+                    '{' objects Objects '}' '{' lights Lights '}'              { Scene $3 $6 $10 $14 }++Camera      : camera '(' double ',' double ',' double ')'+                     '(' int ',' int ')'                                       { Camera ($3,$5,$7) ($10,$12) }++Background  : background '(' double ',' double ',' double ')'                  { ($3,$5,$7) }++Object      : sphere double '(' double ',' double ',' double ')'               { Sphere $2 ($4,$6,$8) }+            | plane '(' double ',' double ',' double ',' double ')'            { Plane ($3,$5,$7,$9) }++NoiseF      : perlinSolid '(' double ',' double ',' double ')' double          { perlinSolid ($3,$5,$7) $9 }+            | perlinSemiTurb '(' double ',' double ',' double ')' int double   { perlinSemiTurbulence ($3,$5,$7) $9 $10 }+            | perlinTurb '(' double ',' double ',' double ')' int double       { perlinTurbulence ($3,$5,$7) $9 $10 }+            | perlinFire '(' double ',' double ',' double ')'+                         '(' double ',' double ',' double ')' int double       { perlinFire ($3,$5,$7) ($10,$12,$14)+										            $16 $17 }+            | perlinPlasma double                                              { perlinPlasma $2 }+            | perlinMarble '(' double ',' double ',' double ')' int double+                           '(' double ',' double ',' double ')' double         { perlinMarble ($3,$5,$7) $9 $10+										              ($12,$14,$16) $18 }+            | perlinMarbleBase '(' double ',' double ',' double ')'+                               '(' double ',' double ',' double ')' int double+                               '(' double ',' double ',' double ')' double     { perlinMarbleBase ($3,$5,$7)+										                  ($10,$12,$14)+                                                                                                  $16 $17+										                  ($19,$21,$23) $25 }+            | perlinWood '(' double ',' double ',' double ')' int double+               	        double double                                          { perlinWood ($3,$5,$7) $9 $10 $11 $12 }++Diff        : solid '(' double ',' double ',' double ')'                       { Solid ($3,$5,$7) }+            | perlin '(' NoiseF ')'                                            { Perlin $3 }++Texture    : '(' texture '(' diff Diff ')' double int double double')'         { Texture $5 $7 $8 $9 $10 }++TexturedObject : '(' object '(' Object ')' Texture ')'                         { ($4,$6) }++Objects     : {- empty -}                                                      { [] }+            | Objects TexturedObject                                           { $2 : $1 }++Light       : '(' pointLight '(' double ',' double ',' double ')'+                            '(' double ',' double ',' double ')' ')'           { PointLight ($4,$6,$8) ($11,$13,$15) }+            | '(' ambientLight '(' double ',' double ',' double ')' ')'        { AmbientLight ($4,$6,$8) }++Lights      : {- empty -}                                                      { [] }+            | Lights Light                                                     { $2 : $1 }++{+-- representation of a full description of scene which should be rendered+data RenderDescr = RenderDescr Resolution Int Scene+++readDescr :: String -> RenderDescr+readDescr = parseScene.lexer++happyError :: [Token] -> a+happyError _ = error "Parse error ! ! !"++data Token+       = TokenInt Int+       | TokenDouble Double+       | TokenCamera+       | TokenBackground+       | TokenDiff+       | TokenSolid+       | TokenPerlinSolid+       | TokenPerlinSemiTurb+       | TokenPerlinTurb+       | TokenPerlinFire+       | TokenPerlinPlasma+       | TokenPerlinMarble+       | TokenPerlinMarbleBase+       | TokenPerlinWood+       | TokenPerlin+       | TokenTexture+       | TokenSphere+       | TokenPlane+       | TokenObjType+       | TokenTexturedObject+       | TokenObjects+       | TokenPointLight+       | TokenAmbientLight+       | TokenLight+       | TokenLights+       | TokenScene+       | TokenResolution+       | TokenRenderDescr+       | TokenOpenAcc+       | TokenCloseAcc+       | TokenOpenBrack+       | TokenCloseBrack+       | TokenOpenHook+       | TokenCloseHook+       | TokenComma++lexer :: String -> [Token]+lexer [] = []+lexer (c:cs)+      | isSpace c = lexer cs+      | isAlpha c = lexVar (c:cs)+      | isDigit c = lexNum (c:cs) 1+lexer ('{':cs) = TokenOpenAcc : lexer cs+lexer ('}':cs) = TokenCloseAcc : lexer cs+lexer ('(':cs) = TokenOpenBrack : lexer cs+lexer (')':cs) = TokenCloseBrack : lexer cs+lexer ('[':cs) = TokenOpenHook : lexer cs+lexer (']':cs) = TokenCloseHook : lexer cs+lexer (',':cs) = TokenComma : lexer cs+lexer ('-':cs) = lexNum cs (-1)++lexNum cs mul+          | (r == '.')  = TokenDouble (mul * (read (num++[r]++num2) :: Double)) : lexer rest2+          | otherwise = TokenInt (round (mul * (read num))) : lexer (r:rest)+          where (num,(r:rest)) = span isDigit cs+	        (num2,rest2)   = span isDigit rest++lexVar cs =+   case span isAlpha cs of+      ("camera",rest)            -> TokenCamera : lexer rest+      ("background",rest)        -> TokenBackground : lexer rest+      ("diff",rest)              -> TokenDiff : lexer rest+      ("solid",rest)             -> TokenSolid : lexer rest+      ("perlinSolid",rest)       -> TokenPerlinSolid : lexer rest+      ("perlinSemiTurb",rest)    -> TokenPerlinSemiTurb : lexer rest+      ("perlinTurb",rest)        -> TokenPerlinTurb : lexer rest+      ("perlinFire",rest)        -> TokenPerlinFire : lexer rest+      ("perlinPlasma",rest)      -> TokenPerlinPlasma : lexer rest+      ("perlinMarble",rest)      -> TokenPerlinMarble : lexer rest+      ("perlinMarbleBase",rest)  -> TokenPerlinMarbleBase : lexer rest+      ("perlinWood",rest)        -> TokenPerlinWood : lexer rest+      ("perlin",rest)            -> TokenPerlin : lexer rest+      ("texture",rest)           -> TokenTexture : lexer rest+      ("sphere",rest)            -> TokenSphere : lexer rest+      ("plane",rest)             -> TokenPlane : lexer rest+      ("object",rest)            -> TokenTexturedObject : lexer rest+      ("objects",rest)           -> TokenObjects : lexer rest+      ("pointLight",rest)        -> TokenPointLight : lexer rest+      ("ambientLight",rest)      -> TokenAmbientLight : lexer rest+      ("light",rest)             -> TokenLight : lexer rest+      ("lights",rest)            -> TokenLights : lexer rest+      ("scene",rest)             -> TokenScene : lexer rest+      ("resolution",rest)        -> TokenResolution : lexer rest+      ("renderDescr",rest)       -> TokenRenderDescr : lexer rest++  }
+ HRayPerlin.lhs view
@@ -0,0 +1,157 @@+	module HRayPerlin, which contains functions used for creating a perlin noise material+	intended for usage with the other modules in the HRay package++   	author: Kenneth Hoste, 2004-2005+	part of a masters thesis at the University of Ghent, Belgium++	=========================================================================++> module HRayPerlin where++> import HRayMath (Point3D, Vector, (<+>), (*>), clip)+> import HRayEngine (Color)++        determines the noise value at a certain intersection point++> noise :: Double -> Point3D -> [Int] -> [Color] -> Double+> noise gridSize (xt,yt,zt) pList gList = res+>   where+>       (x,y,z) = (xt/gridSize,yt/gridSize,zt/gridSize)+>+>       s_curve t = t*t*(3-2*t)+>       lerp t a b = a + t*(b-a)+>+>       (tx,ty,tz) = (x+256,y+256,z+256)+>+>       (bx0,bx1,rx0,rx1) = (mod (floor tx) 256, mod (bx0+1) 256, x - fromIntegral (floor x), rx0 - 1)+>       (by0,by1,ry0,ry1) = (mod (floor ty) 256, mod (by0+1) 256, y - fromIntegral (floor y), ry0 - 1)+>       (bz0,bz1,rz0,rz1) = (mod (floor tz) 256, mod (bz0+1) 256, z - fromIntegral (floor z), rz0 - 1)+>+>       (i,j) = (pList !! bx0, pList !! bx1)+>+>       (b00,b10,b01,b11) = (pList !! mod (i+by0) 256, +>			     pList !! mod (j+by0) 256, +>			     pList !! mod (i+by1) 256, +>			     pList !! mod (j+by1) 256)+>+>       (t,sy,sz) = (s_curve rx0, s_curve ry0, s_curve rz0)+>+>       at3 (qx,qy,qz) (rx,ry,rz) = rx*qx + ry*qy + rz*qz+>+>       u1 = at3 (gList !! mod (b00+bz0) 256) (rx0,ry0,rz0)+>       v1 = at3 (gList !! mod (b10+bz0) 256) (rx1,ry0,rz0)+>       a1 = lerp t u1 v1+>+>       u2 = at3 (gList !! mod (b01+bz0) 256) (rx0,ry1,rz0)+>       v2 = at3 (gList !! mod (b11+bz0) 256) (rx1,ry1,rz0)+>       b1 = lerp t u2 v2+>+>       c = lerp sy a1 b1+>+>       u3 = at3 (gList !! mod (b00+bz1) 256) (rx0,ry0,rz1)+>       v3 = at3 (gList !! mod (b10+bz1) 256) (rx1,ry0,rz1)+>       a2 = lerp t u3 v3+>+>       u4 = at3 (gList !! mod (b01+bz1) 256) (rx0,ry1,rz1)+>       v4 = at3 (gList !! mod (b11+bz1) 256) (rx1,ry1,rz1)+>       b2 = lerp t u4 v4+>+>       d = lerp sy a2 b2+>+>       res = lerp sz c d+>++        perlin noise frequency sum++> semiTurbulence :: Int -> Double -> Point3D -> Double+> semiTurbulence 0 gridS intPt = noise gridS intPt getPList getGList+> semiTurbulence freq gridS intPt = coef + (semiTurbulence (freq-1) gridS intPt)+>   where+>       coef = (1/(2^freq))*(noise gridS (intPt *> (2^freq)) getPList getGList)+++        perlin noise absolute frequency sum++> turbulence :: Int -> Double -> Point3D -> Double+> turbulence 0 gridS intPt = abs (noise gridS intPt getPList getGList)+> turbulence freq gridS intPt = coef + (turbulence (freq-1) gridS intPt)+>   where+>       coef = (1/(2^freq))*(abs (noise gridS (intPt *> (2^freq)) getPList getGList))+++        perlin noise with solid base color++> perlinSolid :: Color -> Double -> Point3D -> Color+> perlinSolid base gridS intPt = base *> (((noise gridS intPt getPList getGList)+1)/2)+++        perlin noise sum with solid base color++> perlinSemiTurbulence :: Color -> Int ->  Double -> Point3D -> Color+> perlinSemiTurbulence base freq gridS intPt = base *> (((semiTurbulence freq gridS intPt)+1)/2)        +++        absolute perlin noise sum with solid base color++> perlinTurbulence :: Color -> Int ->  Double -> Point3D -> Color+> perlinTurbulence base freq gridS intPt = base *> (turbulence freq gridS intPt)+++        perlin noise fire effect++> perlinFire :: Color -> Color -> Int -> Double -> Point3D -> Color+> perlinFire addColor base freq gridS intPt = clip (addColor <+> (perlinTurbulence base freq gridS intPt))+++        perlin noise plasma+        when perlinNoise is really random, and not the same all the time, this can be simplified++> perlinPlasma :: Double -> Point3D -> Color+> perlinPlasma gridS intPt = (noise1,noise2,noise3)+>   where+>       noise1 = (((noise gridS intPt getPList getGList) +1)/2)+>       noise2 = (((noise gridS intPt getPList2 getGList) +1)/2)+>       noise3 = (((noise gridS intPt getPList3 getGList) +1)/2)++        perlin noise marble++> perlinMarble :: Color -> Int -> Double -> (Double,Double,Double) -> Double -> Point3D -> Color+> perlinMarble base freq gridS (xf,yf,zf) pow intPt@(x,y,z) = base *> (((sin (x*xf+y*yf+z*zf + pow*turb))+1)/2)+>   where+>       turb = turbulence freq gridS intPt+++        perlin noise marble with base color++> perlinMarbleBase :: Color -> Color -> Int -> Double -> (Double,Double,Double) -> Double -> Point3D -> Color+> perlinMarbleBase base addColor freq gridS (xf,yf,zf) pow intPt = clip (addColor <+> (perlinMarble base freq gridS (xf,yf,zf) pow intPt))+++        perlin noise wood++> perlinWood :: Color -> Int -> Double -> Double -> Double -> Point3D -> Color+> perlinWood base@(r,g,b) freq gridS xyFact pow intPt@(x,y,z)+>       | (sinVal < 0.5) = clip (r+sinVal,g+sinVal,b+sinVal)+>       | otherwise      = (r,g,b)+>   where+>       sinVal = 0.25 * (abs (sin (xyFact*(sqrt ((x*x+y*y+z*z)) + pow*turb))))+>       turb = turbulence freq gridS intPt+++++	functions which provide the 'random' lists needed in the noise function++> getPList :: [Int]+> getPList = [156,75,107,52,93,1,39,80,70,140,42,161,86,82,47,121,158,30,148,27,29,143,201,164,59,209,63,134,34,217,171,19,187,115,208,111,163,60,241,144,65,238,8,170,193,87,45,147,92,133,250,125,184,10,254,197,243,234,103,212,20,251,43,178,173,123,13,236,139,192,200,242,185,4,252,22,16,88,54,181,96,159,132,168,3,104,36,62,95,221,120,206,12,167,219,58,182,229,14,15,97,227,175,78,145,35,40,223,94,98,237,141,255,146,44,245,235,9,49,69,142,231,247,199,166,124,191,179,152,114,188,126,31,230,61,122,84,99,57,7,83,202,117,17,66,56,211,51,25,71,180,24,246,129,183,226,224,225,213,218,253,28,50,5,18,210,137,38,100,204,118,160,11,48,127,153,101,72,81,102,119,198,0,53,41,135,32,89,248,128,26,136,108,194,74,110,165,85,151,176,222,177,244,249,155,232,205,157,21,23,112,169,207,240,172,203,113,6,131,116,149,195,154,73,214,109,64,150,55,215,130,76,239,91,106,2,138,79,228,37,220,186,189,190,233,90,33,174,67,105,77,46,162,68,216,196]++> getPList2 :: [Int]+> getPList2 = [68,7,60,70,35,136,137,66,139,4,29,172,159,222,44,21,235,128,219,157,19,129,195,201,178,14,6,142,144,151,17,110,231,11,252,246,63,145,192,199,119,84,114,248,193,203,38,229,233,143,208,127,188,164,37,51,34,93,27,3,30,207,130,97,104,111,224,133,118,59,43,230,131,90,206,152,183,138,227,239,171,237,10,218,77,243,100,101,210,177,55,182,147,78,181,25,33,23,91,124,215,168,99,253,197,225,12,251,135,255,242,174,120,238,160,98,154,102,204,95,116,250,31,64,123,109,167,39,86,46,45,28,15,8,180,244,153,196,88,89,191,94,74,202,67,0,36,214,83,73,121,96,122,48,156,176,72,62,52,22,194,175,81,200,20,146,245,234,169,236,16,113,249,187,117,1,166,189,108,254,241,185,217,232,186,32,76,141,105,24,132,13,80,18,9,61,140,26,240,173,125,107,115,190,150,106,112,205,53,87,161,228,65,134,213,82,69,220,58,41,223,184,221,75,57,50,162,170,179,148,5,216,42,56,103,47,49,165,209,247,2,155,92,158,211,126,54,85,40,226,212,163,198,71,149,79]++> getPList3 :: [Int]+> getPList3 = [222,172,15,58,36,53,213,19,219,63,151,189,128,249,156,201,99,32,97,123,73,90,143,33,111,173,91,28,95,6,57,64,61,14,133,50,220,176,9,234,169,193,144,0,43,153,38,214,235,145,59,252,102,92,76,141,125,106,166,244,155,164,187,239,254,250,81,51,159,177,60,115,241,148,87,218,212,11,29,224,221,47,25,230,46,245,86,110,17,217,181,136,71,3,134,139,175,135,21,200,113,227,118,225,67,206,209,121,253,150,199,13,240,138,84,62,185,1,79,208,131,18,41,55,49,94,165,198,170,20,146,247,124,120,31,205,204,68,75,174,101,140,152,103,83,228,142,147,231,26,119,251,88,80,126,202,30,184,2,179,69,180,105,171,4,168,66,186,65,238,246,160,226,117,216,12,127,114,191,243,182,163,223,45,215,157,8,100,42,161,195,229,248,40,109,78,196,130,27,10,44,112,178,35,24,237,255,132,104,129,188,149,107,183,48,190,54,37,23,194,5,207,74,70,122,167,158,108,93,116,7,39,154,203,72,16,89,211,22,56,192,137,232,34,98,236,52,210,162,82,233,96,197,242,77,85]++> getGList :: [Vector]+> getGList = [(-0.4634008664963077,0.6286133493341217,0.6245837765819799),(0.43585568358313037,0.6779977300182028,-0.5919027801746215),(0.6250574787860281,0.7181511458392663,-0.3058791917463542),(0.8135826709105591,0.5768258090053701,-7.317939367978575e-2),(0.8102836947024236,0.33306139598197776,0.48219336433211707),(-0.8219416017916845,0.5525657827170988,-0.1381414456792747),(0.12290483850784734,-0.9695826148952401,-0.21166944409684818),(0.3907853884556271,0.6495836589560424,0.6521716416610466),(0.653487309627378,9.718529220099467e-2,0.7506726018283727),(0.20692854077259132,0.8449582081547479,-0.49317968884134267),(0.5866653947647505,-0.7476406555233711,-0.31121883746666645),(0.6057779397784332,0.7049052390149041,0.36897383604686385),(0.5770184070730312,-0.35910188099757795,0.7335499962258216),(-2.0090358683846572e-2,0.7483658609732847,0.6629818365669369),(0.2992716739795579,-0.6760333349716798,0.6733612664540053),(0.9482677859648617,-0.128144295400657,0.29046040290815583),(0.7345179471496381,-0.4916773197246557,0.467693060225892),(-0.3283486703678434,-0.6758244477474058,0.6598851919043066),(-0.6563929338136774,-0.6792903617374103,-0.3281964669068387),(0.9519853475042687,-0.11899816843803358,-0.2820697325938574),(-0.7276529864219791,0.43829390410212776,0.5276547971714937),(0.48088800920698377,-0.6640834412858347,0.5724857252464093),(0.3583826193080968,0.3162199582130266,0.8783887728139628),(0.46536043035070707,-0.6605115785622939,-0.5892063513311372),(0.7533034799434275,0.6576458951887065,-5.97859904717006e-3),(-0.14104019215200714,0.7584828111285717,-0.6362479779301655),(-0.8026376828487632,6.627283619852173e-2,0.5927737015534444),(0.749177587697674,0.3983722093313028,-0.529180994484865),(-0.37701284859676626,0.15851676588727673,-0.9125424630808092),(0.6393297075616597,-0.59651745035887,-0.4852055816316168),(-0.4410228345484034,0.8869459228140113,0.1372071040817255),(0.913204829352515,-0.3842693588859593,0.13562447960680915),(0.36848266548445074,-0.6004902696783642,-0.709670318710794),(0.3218646979799666,-0.8754719785055092,0.3604884617375626),(5.5982268245459724e-2,0.6388564729187757,-0.7672863824230657),(-0.8480955459415358,-0.454336899611537,-0.2726021397669222),(-0.7926276375139397,-0.6030862459345193,-8.960138511027144e-2),(0.5421365580279602,-0.6265676613273966,-0.559911527143631),(-0.713354593519309,7.98957144741626e-2,0.6962340832748456),(-0.628828647337837,0.625354455916081,0.46206745909354874),(-0.28874012328916265,0.9223642827292696,-0.2566578873681446),(-5.437754783897633e-3,-0.7232213862583852,0.6905948575549994),(0.41144386020951107,0.2549792936509646,0.8750425759385376),(0.37180144391637504,-0.3563097170865261,0.8572088845849758),(-0.2748176998042737,0.9498085414288056,0.1494622577882892),(-0.21756086223891782,0.9324036953096478,0.28860114378631957),(-0.26691469746914426,-0.9633952361776925,2.5023252887732272e-2),(-0.20920802010140857,-0.6879043372825976,-0.6949961345741708),(0.847882935691488,-0.3491282676376715,0.3990037344430532),(0.2271631333745012,-0.6382202318616939,0.7355758604507657),(-0.592382011041402,0.11626189001747142,-0.7972243886912327),(0.76585513461521,0.6368690066800168,8.867796295544537e-2),(-0.12653619804509905,0.9701108516790928,-0.20705923316470756),(0.889904549324724,0.2251565727207133,-0.39670443765078056),(-0.3626509825924703,-0.675395866663041,0.642125134315108),(-0.3757202342849532,0.6427610619585563,0.6676020691840078),(-9.446769167000744e-3,0.6927630722467213,-0.7211033797477235),(-0.6024071619888135,0.6515832568450431,-0.46102588927715316),(0.6066694021538221,-0.7890424126172411,9.676935249079371e-2),(0.7184143150243675,-0.4555798095276477,-0.5256690109934397),(-0.5499984410497121,-0.5999982993269587,-0.5809507342689599),(0.565131689477802,-0.1266674476415763,-0.8152187014880937),(0.1738902175481343,-0.5578977813002642,0.8114876818912935),(-1.3570632358703896e-2,-0.9499442651092728,0.3121245442501896),(0.5796148950595086,0.5350291339010848,-0.6146465645411272),(0.3525789014949555,0.8402581297309688,0.4118912400642004),(-0.4195972942125916,-0.817786563210255,-0.3939076639546778),(0.8630690012043962,0.22588134015896308,0.45176268031792616),(0.33917693997389664,0.559846274414745,0.7559967939177213),(0.8029504988635409,0.4959400140039517,-0.33062667600263446),(-0.82489689433191,0.5649293882394293,1.9997500468652365e-2),(-0.5873656615794404,-0.5229449115997599,0.6176813086287019),(0.674305927100485,0.4680476435168072,0.5711767853086461),(0.39560567798776436,-0.9152071654940818,7.675931065434234e-2),(0.33078363377166053,0.6929046644269521,0.6406756696209004),(-0.6796880424946163,-0.7267433685134744,9.9339021595367e-2),(0.6255520917145204,0.4525270450700786,-0.6355343059440075),(0.5555476822360781,-0.5828138261495053,0.5930386301170404),(3.1884995581813735e-2,0.7420508062676651,0.6695849072180884),(-0.3826877903138114,0.6250567241792253,-0.6803338494467758),(0.7090281371617104,0.6901207201707316,-0.14495686359750526),(-0.14631124493166056,0.7559414321469129,0.6380795959519642),(0.7571459658272776,0.6523103705588853,3.4945198422797426e-2),(-0.5884180662449523,-0.763911173721517,-0.264960181876382),(0.5030489248048373,0.6148375747614677,-0.6073849980976924),(5.4365842885224454e-2,0.7899037172147317,0.6108162347692865),(0.3412569003471914,0.9384564759547764,5.332139067924866e-2),(0.5798245325734733,0.6876988642150498,0.43689104314838456),(-0.513804404202253,0.6870298890475841,0.513804404202253),(-0.6163246413943037,0.46673128183257945,0.6342758445417106),(-0.12464211362686843,-0.7270789961567325,-0.6751447821455373),(-0.5476596298214216,0.7982835282142755,0.2506238983928539),(-0.49389773650771324,0.4326391025222604,0.7542469309458877),(-0.6216210956407131,0.24103675137088876,0.745311007528406),(0.3892647784833973,-0.4923054551407672,-0.7785295569667946),(-0.5144957554275265,-0.8231932086840423,-0.24009801919951235),(0.8808895871984485,5.551825129401986e-2,0.4700545276227015),(-8.974452955710893e-2,8.974452955710893e-2,-0.9919132214206777),(-0.46125358714308906,-0.6378478176493003,0.6167619393799019),(-0.107300150387041,0.41578808274978385,-0.9031095990909284),(0.44957071606417937,0.5046201915006095,-0.7370513100099811),(0.26461408801082403,0.28866991419362625,-0.9201353514921836),(-0.7110543723962668,2.5096036672809414e-2,0.7026890268386636),(-0.6023056672991455,0.6170560101717776,-0.5064284386270366),(-0.307970416434183,0.7628190314754378,-0.5685607688015686),(-0.8177770089795866,-0.13629616816326443,0.559163766823649),(-1.117964118175896e-2,-0.8943712945407168,-0.4471856472703584),(-0.6043991523488209,0.7188686887785218,-0.3434086092891028),(-0.9552357026015896,-0.16318609919443822,0.2467692231720773),(-0.5928165666406283,-0.6354652404996664,-0.49472461676484086),(-0.5104239604648815,9.496259729579191e-2,0.8546633756621272),(0.5796273126824756,-0.49562335432269644,-0.6468304793702988),(-6.689730287799096e-2,0.6052613117532516,0.7932108769818929),(0.8646494312593326,-0.32096834948263103,0.38647209427500473),(-4.450228396058756e-2,0.5374506601394036,-0.8421201426388106),(0.3281220021482102,0.7048546712813405,-0.628900504117403),(0.12024122368609878,0.8346155526446857,0.5375490000084416),(0.2624174380561661,0.4373623967602768,-0.8601460469618777),(0.3745614500057702,-0.11157149574639962,0.9204648399077969),(-0.7034195842885712,0.6659038731265141,0.2485415864486285),(0.6737504311483288,0.2844110426568765,-0.6820342479247427),(-0.2669341008999655,0.5524052921402064,0.7896800484957313),(-0.5862797614630307,-0.36078754551571124,-0.7253332946305444),(-0.6060432152628561,-0.7342446646453834,0.30593527693557643),(0.5939513859122539,-0.774392313278002,-0.2180327872336122),(0.8277621201319056,0.1464764245500903,0.5416221279875432),(0.39046761083480547,0.8785521243783123,0.2751021803608857),(8.110849338581397e-2,0.7812028573475767,-0.6189858705759487),(-0.7531008727607394,-0.10336678645735639,0.649734086303383),(0.1710343857312061,-0.4357304588866441,-0.8836776596112315),(0.777465131462145,-0.5483570492438318,-0.3079813564246178),(-0.20076323572995633,0.5152923050402213,0.8331674282793188),(0.7699499314842428,-0.5145704987642218,0.3773516990937626),(0.1413841819385486,0.9705833030376039,-0.19488089942881023),(0.17477342688942704,0.3495468537788541,0.9204733816176491),(0.7135903152997383,-0.6589460118758845,0.23786343843324612),(-0.7566535227522645,0.4431230575234256,-0.48074671335088626),(-0.6749413541043249,0.6240529186758242,-0.39371578989418954),(0.8135083195168874,3.2671016848067765e-3,-0.5815440998956063),(-0.6433314281494985,0.36693718494452876,0.671923936067254),(0.1602165143081764,0.5955874771021341,-0.7871507007314754),(-0.7094407780723715,-0.5521299968476282,0.43800256733163806),(-6.619347516577881e-2,0.3699047141617051,-0.9267086523209033),(-0.3686998540924837,0.531361554427403,-0.762702639348177),(-0.40459364116157837,0.6342278699289607,-0.6588315372968946),(0.6414128794195922,9.377381278064213e-2,0.7614433597788142),(0.91635097414675,-0.2290877435366875,-0.3283590990692521),(0.8134344345567368,-0.3120502787739206,0.4908656070600998),(-0.6942673149736415,0.15362510799416748,-0.703130301973305),(-0.6235409359014416,-4.2838690252770796e-2,-0.7806161334949345),(0.5316366869934472,0.8468548996355797,1.4114248327259663e-2),(0.37973865183871736,-0.7673069666019443,0.5167577530176359),(-6.336347940953027e-2,-0.9702532784584323,0.2336528303226429),(0.8622553900225496,-0.3546372975092744,-0.3615909700094563),(5.446224937577672e-2,-9.077041562629454e-3,-0.9984745718892399),(-0.7065618047809735,-0.23552060159365787,0.6673083711820306),(-0.13569070631055166,-0.7802215612856721,0.6106081783974825),(0.48032525337147763,0.47724624533704507,-0.7358829202293792),(0.3773270957040923,0.4934277405361207,0.7836793526161917),(-0.14333120333184565,-0.8328705058472111,-0.5345866502647216),(2.5896477766233644e-2,0.7930796315909053,-0.6085672275064906),(0.7047777170117738,-0.7077895875972943,4.818992936832642e-2),(-0.6455791529870523,-4.210298823828602e-2,-0.7625318980934024),(0.28876831313241136,-0.681057342293423,-0.6728846541859019),(0.5549893897993612,-0.7273724578431021,0.4036286471268081),(0.5753164920729048,0.2876582460364524,-0.7656785666558513),(4.4614135635061274e-2,-3.9037368680678614e-2,-0.9982412848344959),(-0.8117807156413794,-0.5109869683278326,-0.2826736420536946),(0.7034358462564636,0.4378529247106559,-0.5598775102857567),(-0.8964469089202429,-0.4427794448917799,1.814669856113852e-2),(0.74034193688776,0.672230478694086,0.0),(-0.8302389420915597,0.4879474484222325,0.2694635162928746),(0.1656914962471534,-0.803603756798694,-0.5716356620526792),(5.888979223614891e-3,-0.5005632340072658,0.865679945871389),(0.5924190356676485,-0.6994827168124044,-0.3997044096070882),(-0.40908156114292343,0.5408196910025089,0.7349600929008455),(-0.60576300789061,0.34294519494336123,-0.7179413426851674),(-0.10180318074302291,0.7397697800659665,-0.6651141141877497),(-0.5386706239008539,0.5510065923871329,-0.6373583717910866),(0.63157591843216,0.7645392696810358,0.12880824652234843),(0.7892023356285827,1.9486477422927966e-2,0.6138240388222309),(-0.5529373873424747,-0.7151323542962672,0.42760491287818037),(-0.5314402884414319,-0.6128091364324645,-0.584838594935547),(0.908379410352939,-0.4159868327784487,4.244763599780089e-2),(0.16202092850385774,-0.7908164367450199,-0.5902190966926246),(-0.3602405233139769,-0.8201220424382027,0.4445521351534183),(0.5142949713279265,0.32759885159929564,0.7925778667724894),(-0.9525128068265735,5.291737815703186e-2,-0.2998651428898472),(0.6565884633026523,0.45903087257442066,-0.5984832895590548),(0.12271981244438597,0.7708338219162993,0.625104044638591),(-0.6826155860103779,0.48850688856666846,0.5435043528423861),(-6.395859981091866e-2,0.58273390938837,-0.8101422642716363),(-0.37986493543401506,0.7287204883836207,-0.5697974031510226),(-0.6376631059903642,-0.3816997465435279,-0.6690972027645371),(0.8678983685961432,0.20852103661076168,-0.45085629537461985),(0.9357809733432827,-0.17155984511293518,-0.3080279037254972),(0.610995665542666,-0.5395805877519648,-0.5792556309690211),(-0.5111334100566033,0.6002845862292666,0.6151431155913771),(0.8791306287808245,-0.2712745940237973,0.39184108025659603),(0.679728163091276,0.6997201678880783,0.21991205276482462),(-0.6128932644299215,0.2615531765401576,-0.7456217420771657),(0.16377449574589417,-0.8188724787294709,-0.5501143318644137),(0.8215670697539412,0.4146957590186561,-0.3912224141685435),(-0.534234229136161,-0.17957453080207095,0.8260428416895264),(-0.6518811198847961,-0.7363842280180104,0.1810780888568878),(0.14676947392042217,0.8219090539543641,-0.5503855272015831),(-0.46203346615158325,0.5734165338845543,0.6765490040076755),(0.1400637354848092,-0.8900824480808842,0.4337457615013446),(-0.9296984743221126,4.067430825159243e-2,-0.3660687742643319),(-0.9416366314963587,0.33491199780025127,3.397657948698202e-2),(-0.37496383625045837,0.9165782663900093,0.13887549490757717),(0.49729065222930485,0.8181233310869209,-0.2887494109718544),(0.3548819345758441,9.08843978791796e-2,-0.9304831211439815),(0.5159143363118958,-0.3933846814378205,0.7609736460600462),(-0.19582093200357792,-0.276703490874621,0.9407918689737113),(-0.6342530151141949,-0.6437668103409078,-0.4281207852020815),(0.8692840535434653,0.48852326975996396,7.543374018352385e-2),(0.10369715823742881,0.6722436465047109,-0.733031635816307),(0.5477083230489346,0.5722325763197824,0.6103814147411012),(-9.311114793883159e-2,0.6397636939022944,-0.7629106960149427),(-0.6142510719777644,-0.3604024146808311,0.702001225117445),(-0.9274749843799155,0.3684489663975007,6.352568386163805e-2),(-0.52446882788379,-0.38198307695582395,-0.7609345421897763),(3.691843631728479e-2,0.992695732086991,0.11485735743155269),(5.2970840542959224e-2,0.6687568618548602,0.7415917676014291),(-0.6545011330066678,0.6594973248616804,0.3697181972709421),(-0.7661045485684261,-0.5528589525751528,-0.32776637902669775),(0.7312694891319046,0.3772791631827024,-0.5682476284974035),(-0.38842121143594915,0.9078216685886719,-0.15807840000300258),(-0.3709951793578669,0.4288568128356994,-0.8236773706844385),(0.5147990812824593,0.5026144876426378,0.6945218374698269),(-0.6073542836083838,0.3795964272552399,0.6978734316461718),(0.44935605722680466,-0.4752182763477718,-0.7564699092882898),(-0.6540911945904198,-0.66090464453407,-0.36792629695711115),(-0.37102177884896653,0.3544088633781173,0.8583339659938778),(0.4810266182378922,0.14999754762256853,-0.8637789811368602),(0.6198338632077788,-0.41451389602020206,-0.6663214029483622),(0.6155080037411411,0.16513629368664762,-0.7706360372043555),(-0.2575061713069756,-0.8113873699672628,0.5247295566255352),(-0.10111561737561009,3.370520579187003e-2,0.994303570860166),(0.6197306037839875,0.1070443770172342,-0.7774802120199115),(0.24030301255873365,-0.38448482009397383,0.8913057193087576),(0.6252144815496288,-0.7755825214159953,-8.705518097526477e-2),(0.364614053701737,-0.5280617329473433,0.7669468026139985),(-0.13732820033006526,0.7641081915801067,-0.6303012271559405),(0.6305193663883901,0.7005770737648779,-0.334121373641711),(-0.2277672332425418,-0.49442155508746877,0.8388500541371661),(0.8628965392546408,-0.15828279714138382,0.4799542881061316),(0.6217049841833915,0.41786728445113197,-0.6624725241298434),(0.8205476791132401,0.0,-0.5715780841686245),(0.1173090030747732,0.9611769929352384,0.24975465170758163),(-0.6589925661940386,0.5375991987372419,0.5260379256461185),(0.8035155023932737,-0.5499999160766793,0.22773434025050004),(0.7719661916265194,-0.6339977658890138,4.5989475245835194e-2),(0.13834567131894154,-0.6640592223309194,0.7347692321161562),(0.2562911149706711,0.2462404830110369,0.9347087722459768)]++}
+ LICENSE view
@@ -0,0 +1,28 @@+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++1. Redistributions of source code must retain the above copyright+   notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+   notice, this list of conditions and the following disclaimer in the+   documentation and/or other materials provided with the distribution.++3. Neither the name of the author nor the names of his contributors+   may be used to endorse or promote products derived from this software+   without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.
+ PixBufExtras.lhs view
@@ -0,0 +1,50 @@+> {-# OPTIONS -O #-}+++	module PixBufExtras, which contains a function needed to+	draw a bitmap image in the graphical user interface++   	author: Kenneth Hoste, 2004-2005+ 	part of a masters thesis at the University of Ghent, Belgium++	special thanks to Duncan Coutts	++	=========================================================================+++> module PixBufExtras (pixbufSetPixelsRGB8) where++> import Graphics.UI.Gtk++> import Data.Word (Word8)+> import Data.Array.MArray+> import Data.Array.Base (unsafeWrite)++> {-# INLINE pixbufSetPixelsRGB8 #-}+> pixbufSetPixelsRGB8 :: Pixbuf -> (Int -> Int -> (Word8, Word8, Word8)) -> IO ()+> pixbufSetPixelsRGB8 pixbuf setPixel = do+>  -- assert that the format is RGB8+>  3 <- pixbufGetNChannels pixbuf+>  8 <- pixbufGetBitsPerSample pixbuf+>  -- get the pixel array+>  pixelData <- pixbufGetPixels pixbuf+>  -- get the dimensions+>  rowStride <- pixbufGetRowstride pixbuf+>  width <- pixbufGetWidth pixbuf+>  height <- pixbufGetHeight pixbuf+>  doFromTo 0 (height-1) $ \y ->+>    doFromTo 0 (width-1) $ \x ->+>      case setPixel x y of+>        (red, green, blue) -> do+>          unsafeWrite pixelData (x*3 + y*rowStride + 0) red+>          unsafeWrite pixelData (x*3 + y*rowStride + 1) green+>          unsafeWrite pixelData (x*3 + y*rowStride + 2) blue++> {-# INLINE doFromTo #-}+> -- do the action for [from..to], ie it's inclusive.+> doFromTo :: Int -> Int -> (Int -> IO ()) -> IO ()+> doFromTo from to action =+>   let loop n | n > to   = return ()+>              | otherwise = do action n+>                               loop (n+1)+>    in loop from
+ Setup.hs view
@@ -0,0 +1,5 @@+#!/usr/bin/runhaskell++import Distribution.Simple++main = defaultMainWithHooks simpleUserHooks
+ dist/build/HRay/HRay-tmp/HRayParser.hs view
@@ -0,0 +1,1078 @@+{-# OPTIONS -fglasgow-exts -cpp #-}+{-+     module HRayParser, which contains a parser which allows to use files containing scene descriptions+     intended for usage with the other modules in the HRay package++     author: Kenneth Hoste, 2004-2005+     part of a masters thesis at the University of Ghent, Belgium+-}++module HRayParser (RenderDescr(RenderDescr), readDescr) where++import HRayEngine (Scene(Scene), Texture(Texture), Diff(Solid,Perlin), TexturedObject,+		   Light(AmbientLight, PointLight), Camera(Camera))+import HRayPerlin (perlinSolid, perlinSemiTurbulence,perlinTurbulence,perlinFire,perlinPlasma,perlinMarble,+		   perlinMarbleBase,perlinWood)+import HRayMath (Dimension, Resolution, Object(Sphere,Plane))+import Data.Char (isSpace, isAlpha, isDigit)+#if __GLASGOW_HASKELL__ >= 503+import Data.Array+#else+import Array+#endif+#if __GLASGOW_HASKELL__ >= 503+import GHC.Exts+#else+import GlaExts+#endif++-- parser produced by Happy Version 1.17++newtype HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 = HappyAbsSyn HappyAny+#if __GLASGOW_HASKELL__ >= 607+type HappyAny = GHC.Exts.Any+#else+type HappyAny = forall a . a+#endif+happyIn4 :: t4 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn4 x = unsafeCoerce# x+{-# INLINE happyIn4 #-}+happyOut4 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t4+happyOut4 x = unsafeCoerce# x+{-# INLINE happyOut4 #-}+happyIn5 :: t5 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn5 x = unsafeCoerce# x+{-# INLINE happyIn5 #-}+happyOut5 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t5+happyOut5 x = unsafeCoerce# x+{-# INLINE happyOut5 #-}+happyIn6 :: t6 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn6 x = unsafeCoerce# x+{-# INLINE happyIn6 #-}+happyOut6 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t6+happyOut6 x = unsafeCoerce# x+{-# INLINE happyOut6 #-}+happyIn7 :: t7 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn7 x = unsafeCoerce# x+{-# INLINE happyIn7 #-}+happyOut7 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t7+happyOut7 x = unsafeCoerce# x+{-# INLINE happyOut7 #-}+happyIn8 :: t8 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn8 x = unsafeCoerce# x+{-# INLINE happyIn8 #-}+happyOut8 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t8+happyOut8 x = unsafeCoerce# x+{-# INLINE happyOut8 #-}+happyIn9 :: t9 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn9 x = unsafeCoerce# x+{-# INLINE happyIn9 #-}+happyOut9 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t9+happyOut9 x = unsafeCoerce# x+{-# INLINE happyOut9 #-}+happyIn10 :: t10 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn10 x = unsafeCoerce# x+{-# INLINE happyIn10 #-}+happyOut10 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t10+happyOut10 x = unsafeCoerce# x+{-# INLINE happyOut10 #-}+happyIn11 :: t11 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn11 x = unsafeCoerce# x+{-# INLINE happyIn11 #-}+happyOut11 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t11+happyOut11 x = unsafeCoerce# x+{-# INLINE happyOut11 #-}+happyIn12 :: t12 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn12 x = unsafeCoerce# x+{-# INLINE happyIn12 #-}+happyOut12 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t12+happyOut12 x = unsafeCoerce# x+{-# INLINE happyOut12 #-}+happyIn13 :: t13 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn13 x = unsafeCoerce# x+{-# INLINE happyIn13 #-}+happyOut13 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t13+happyOut13 x = unsafeCoerce# x+{-# INLINE happyOut13 #-}+happyIn14 :: t14 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn14 x = unsafeCoerce# x+{-# INLINE happyIn14 #-}+happyOut14 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t14+happyOut14 x = unsafeCoerce# x+{-# INLINE happyOut14 #-}+happyIn15 :: t15 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn15 x = unsafeCoerce# x+{-# INLINE happyIn15 #-}+happyOut15 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t15+happyOut15 x = unsafeCoerce# x+{-# INLINE happyOut15 #-}+happyIn16 :: t16 -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyIn16 x = unsafeCoerce# x+{-# INLINE happyIn16 #-}+happyOut16 :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> t16+happyOut16 x = unsafeCoerce# x+{-# INLINE happyOut16 #-}+happyInTok :: Token -> (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)+happyInTok x = unsafeCoerce# x+{-# INLINE happyInTok #-}+happyOutTok :: (HappyAbsSyn t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16) -> Token+happyOutTok x = unsafeCoerce# x+{-# INLINE happyOutTok #-}+++happyActOffsets :: HappyAddr+happyActOffsets = HappyA# "\xde\x00\xde\x00\xda\x00\xd8\x00\xe6\x00\xdc\x00\xd6\x00\xd5\x00\xd4\x00\xe2\x00\xd0\x00\xcd\x00\xcf\x00\xd9\x00\x00\x00\xd7\x00\xca\x00\xc8\x00\xc9\x00\xd3\x00\xc4\x00\xc7\x00\x00\x00\xd2\x00\xc1\x00\xd1\x00\xc5\x00\xc3\x00\xce\x00\xc0\x00\xbd\x00\xcc\x00\xbe\x00\xbc\x00\xcb\x00\x00\x00\xbb\x00\xba\x00\xec\xff\xb9\x00\xc6\x00\x00\x00\xb6\x00\xb7\x00\xc2\x00\xb3\x00\xb2\x00\xaf\x00\xae\x00\x00\x00\x00\x00\xf5\xff\xbf\x00\xad\x00\xab\x00\xb8\x00\xaa\x00\xe8\xff\x00\x00\x00\x00\xed\xff\xb5\x00\xa8\x00\xa5\x00\x00\x00\xa3\x00\xa9\x00\xb4\x00\x9e\x00\xa1\x00\x9f\x00\xb1\x00\xb0\x00\xa7\x00\x9c\x00\x9b\x00\x00\x00\xac\x00\xa6\x00\x9a\x00\x94\x00\x93\x00\xa4\x00\xa2\x00\x9d\x00\x8e\x00\xfb\xff\x92\x00\x91\x00\x8d\x00\x99\x00\x8c\x00\x8b\x00\x8a\x00\x98\x00\x97\x00\x96\x00\x89\x00\x04\x00\x95\x00\x90\x00\x88\x00\x70\x00\x87\x00\x86\x00\x85\x00\x84\x00\x83\x00\x82\x00\x81\x00\x80\x00\x7f\x00\x00\x00\x78\x00\x77\x00\x76\x00\x75\x00\x73\x00\x00\x00\x7e\x00\x7d\x00\x7c\x00\x00\x00\x7b\x00\x7a\x00\x79\x00\x74\x00\x00\x00\x72\x00\x71\x00\x6f\x00\x6e\x00\x6d\x00\x6c\x00\x6b\x00\x6a\x00\x69\x00\x66\x00\x61\x00\x68\x00\x00\x00\x60\x00\x67\x00\x65\x00\x64\x00\x63\x00\x62\x00\x5f\x00\x5e\x00\x5d\x00\x5c\x00\x00\x00\x5b\x00\x57\x00\x56\x00\x54\x00\x51\x00\x4f\x00\x4c\x00\x47\x00\x5a\x00\x2c\x00\x59\x00\x58\x00\x55\x00\x53\x00\x52\x00\x50\x00\x4e\x00\x00\x00\x45\x00\x44\x00\x40\x00\x3f\x00\x3b\x00\x3a\x00\x38\x00\x4d\x00\x35\x00\x4b\x00\x34\x00\x4a\x00\x31\x00\x49\x00\x48\x00\x46\x00\x00\x00\x43\x00\x42\x00\x41\x00\x3e\x00\x3d\x00\x3c\x00\x29\x00\x00\x00\x39\x00\x25\x00\x24\x00\x21\x00\x00\x00\x00\x00\x37\x00\x36\x00\x33\x00\x32\x00\x00\x00\x1c\x00\x1b\x00\x19\x00\x30\x00\x2f\x00\x2e\x00\x18\x00\x16\x00\x15\x00\x2d\x00\x2b\x00\x2a\x00\x28\x00\x11\x00\x27\x00\x00\x00\x26\x00\x0a\x00\x23\x00\x00\x00\x05\x00\x22\x00\x02\x00\x20\x00\x03\x00\x1e\x00\x00\x00\x00\x00"#++happyGotoOffsets :: HappyAddr+happyGotoOffsets = HappyA# "\x1f\x00\x00\x00\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyDefActions :: HappyAddr+happyDefActions = HappyA# "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xeb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xff\xe7\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe6\xff\xfc\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xff\x00\x00\x00\x00\x00\x00\xf3\xff\x00\x00\x00\x00\x00\x00\x00\x00\xee\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe8\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xed\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf7\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe9\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf5\xff\xf6\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf4\xff\x00\x00\x00\x00\x00\x00\xf2\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\xff"#++happyCheck :: HappyAddr+happyCheck = HappyA# "\xff\xff\x06\x00\x15\x00\x16\x00\x1c\x00\x1d\x00\x11\x00\x12\x00\x1c\x00\x1d\x00\x0f\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x06\x00\x08\x00\x07\x00\x0b\x00\x05\x00\x04\x00\x09\x00\x03\x00\x0c\x00\x02\x00\x0a\x00\x01\x00\x00\x00\x02\x00\x1e\x00\x02\x00\x21\x00\x02\x00\x02\x00\x21\x00\x1d\x00\x02\x00\x02\x00\x02\x00\x01\x00\xff\xff\x02\x00\x01\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x1e\x00\x02\x00\x02\x00\x1e\x00\x21\x00\x02\x00\x02\x00\x21\x00\x02\x00\x21\x00\x21\x00\x02\x00\x02\x00\x02\x00\x1d\x00\x21\x00\x02\x00\x02\x00\x02\x00\x21\x00\x1e\x00\x02\x00\x01\x00\x01\x00\x01\x00\x01\x00\x21\x00\x1d\x00\x02\x00\x02\x00\x1d\x00\x02\x00\x1e\x00\x02\x00\x02\x00\x1e\x00\x02\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x02\x00\x21\x00\x02\x00\x02\x00\xff\xff\xff\xff\x21\x00\xff\xff\xff\xff\x21\x00\x02\x00\x21\x00\x02\x00\x02\x00\x21\x00\x02\x00\x21\x00\x21\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x21\x00\x21\x00\xff\xff\x02\x00\xff\xff\xff\xff\x21\x00\xff\xff\x01\x00\x21\x00\x21\x00\x21\x00\x21\x00\x21\x00\x21\x00\x1d\x00\x21\x00\x02\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x1d\x00\x1d\x00\x1d\x00\x02\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x02\x00\x1e\x00\x02\x00\x1e\x00\x02\x00\x02\x00\x1d\x00\x21\x00\x21\x00\x21\x00\x1d\x00\x21\x00\x1e\x00\x05\x00\x02\x00\x02\x00\x21\x00\x21\x00\x02\x00\x02\x00\x1d\x00\x10\x00\x02\x00\x21\x00\x1d\x00\x21\x00\x1d\x00\x21\x00\x01\x00\x1e\x00\x1d\x00\x01\x00\xff\xff\x1d\x00\x17\x00\x1d\x00\x02\x00\x1e\x00\x13\x00\x1e\x00\x1e\x00\x02\x00\x02\x00\x1d\x00\x02\x00\x1b\x00\x14\x00\x02\x00\x21\x00\x02\x00\x04\x00\x1d\x00\x01\x00\x1e\x00\x21\x00\x1b\x00\x03\x00\x21\x00\x21\x00\x1b\x00\x1d\x00\x1c\x00\x21\x00\x01\x00\x1c\x00\x1e\x00\x1d\x00\x01\x00\x1e\x00\xff\xff\x1b\x00\xff\xff\x18\x00\x20\x00\xff\xff\xff\xff\xff\xff\x21\x00\xff\xff\x1d\x00\x1f\x00\x19\x00\xff\xff\x1d\x00\x1a\x00\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++happyTable :: HappyAddr+happyTable = HappyA# "\x00\x00\x59\x00\x46\x00\x47\x00\x3c\x00\x3d\x00\x38\x00\x39\x00\x2b\x00\x2c\x00\x5a\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x67\x00\x41\x00\x57\x00\x3a\x00\x36\x00\x1a\x00\x29\x00\x11\x00\x39\x00\x0b\x00\x26\x00\x04\x00\x03\x00\xe9\x00\xe8\x00\xe7\x00\xe6\x00\xe5\x00\xe3\x00\xe4\x00\xe1\x00\xe2\x00\xde\x00\xe0\x00\xdb\x00\x00\x00\xdc\x00\xdd\x00\xdf\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xce\x00\xcf\x00\xda\x00\xd9\x00\xd0\x00\xd1\x00\xd2\x00\xcd\x00\xd3\x00\xd4\x00\xc4\x00\xc5\x00\xc6\x00\xcb\x00\xca\x00\xc7\x00\xc8\x00\xc9\x00\xcc\x00\xc3\x00\xbb\x00\xbc\x00\xbd\x00\xbf\x00\xc1\x00\xb2\x00\xbe\x00\xb3\x00\xab\x00\xc0\x00\xac\x00\xc2\x00\xad\x00\xae\x00\xb4\x00\xaf\x00\xb5\x00\xb6\x00\xb0\x00\xb1\x00\xa2\x00\xb7\x00\xb8\x00\x99\x00\x9a\x00\x9b\x00\xb9\x00\xba\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa3\x00\xa0\x00\x8e\x00\x00\x00\x00\x00\xa4\x00\x00\x00\x00\x00\xa5\x00\x97\x00\xa6\x00\x83\x00\x84\x00\xa7\x00\x85\x00\xa8\x00\xa9\x00\xaa\x00\x98\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\xa1\x00\x8f\x00\x00\x00\x7b\x00\x00\x00\x00\x00\x90\x00\x00\x00\x82\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x8c\x00\x81\x00\x66\x00\x8d\x00\x75\x00\x76\x00\x77\x00\x67\x00\x72\x00\x73\x00\x74\x00\x62\x00\x78\x00\x79\x00\x7a\x00\x5c\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x5d\x00\x80\x00\x5e\x00\x71\x00\x56\x00\x50\x00\x63\x00\x5f\x00\x60\x00\x61\x00\x64\x00\x5b\x00\x65\x00\x57\x00\x51\x00\x52\x00\x53\x00\x54\x00\x4b\x00\x45\x00\x4e\x00\x4c\x00\x3f\x00\x55\x00\x48\x00\x4f\x00\x49\x00\x4a\x00\x36\x00\x4d\x00\x43\x00\x2e\x00\x00\x00\x44\x00\x33\x00\x3e\x00\x31\x00\x40\x00\x2f\x00\x41\x00\x32\x00\x28\x00\x25\x00\x34\x00\x22\x00\x30\x00\x24\x00\x1f\x00\x35\x00\x19\x00\x1c\x00\x2d\x00\x11\x00\x26\x00\x29\x00\x21\x00\x13\x00\x23\x00\x20\x00\x18\x00\x1d\x00\x1e\x00\x1a\x00\x0b\x00\x15\x00\x17\x00\x14\x00\x08\x00\x16\x00\x00\x00\x0e\x00\x00\x00\x0d\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x0a\x00\x09\x00\x07\x00\x00\x00\x06\x00\x03\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyReduceArr = array (1, 25) [+	(1 , happyReduce_1),+	(2 , happyReduce_2),+	(3 , happyReduce_3),+	(4 , happyReduce_4),+	(5 , happyReduce_5),+	(6 , happyReduce_6),+	(7 , happyReduce_7),+	(8 , happyReduce_8),+	(9 , happyReduce_9),+	(10 , happyReduce_10),+	(11 , happyReduce_11),+	(12 , happyReduce_12),+	(13 , happyReduce_13),+	(14 , happyReduce_14),+	(15 , happyReduce_15),+	(16 , happyReduce_16),+	(17 , happyReduce_17),+	(18 , happyReduce_18),+	(19 , happyReduce_19),+	(20 , happyReduce_20),+	(21 , happyReduce_21),+	(22 , happyReduce_22),+	(23 , happyReduce_23),+	(24 , happyReduce_24),+	(25 , happyReduce_25)+	]++happy_n_terms = 35 :: Int+happy_n_nonterms = 13 :: Int++happyReduce_1 = happyReduce 6# 0# happyReduction_1+happyReduction_1 (happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut5 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokenInt happy_var_3) -> +	case happyOut6 happy_x_5 of { happy_var_5 -> +	happyIn4+		 (RenderDescr happy_var_2 happy_var_3 happy_var_5+	) `HappyStk` happyRest}}}++happyReduce_2 = happyReduce 8# 1# happyReduction_2+happyReduction_2 (happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_4 of { (TokenInt happy_var_4) -> +	case happyOutTok happy_x_6 of { (TokenInt happy_var_6) -> +	happyIn5+		 ((happy_var_4,happy_var_6)+	) `HappyStk` happyRest}}++happyReduce_3 = happyReduce 15# 2# happyReduction_3+happyReduction_3 (happy_x_15 `HappyStk`+	happy_x_14 `HappyStk`+	happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut7 happy_x_3 of { happy_var_3 -> +	case happyOut8 happy_x_6 of { happy_var_6 -> +	case happyOut14 happy_x_10 of { happy_var_10 -> +	case happyOut16 happy_x_14 of { happy_var_14 -> +	happyIn6+		 (Scene happy_var_3 happy_var_6 happy_var_10 happy_var_14+	) `HappyStk` happyRest}}}}++happyReduce_4 = happyReduce 13# 3# happyReduction_4+happyReduction_4 (happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_10 of { (TokenInt happy_var_10) -> +	case happyOutTok happy_x_12 of { (TokenInt happy_var_12) -> +	happyIn7+		 (Camera (happy_var_3,happy_var_5,happy_var_7) (happy_var_10,happy_var_12)+	) `HappyStk` happyRest}}}}}++happyReduce_5 = happyReduce 8# 4# happyReduction_5+happyReduction_5 (happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	happyIn8+		 ((happy_var_3,happy_var_5,happy_var_7)+	) `HappyStk` happyRest}}}++happyReduce_6 = happyReduce 9# 5# happyReduction_6+happyReduction_6 (happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokenDouble happy_var_2) -> +	case happyOutTok happy_x_4 of { (TokenDouble happy_var_4) -> +	case happyOutTok happy_x_6 of { (TokenDouble happy_var_6) -> +	case happyOutTok happy_x_8 of { (TokenDouble happy_var_8) -> +	happyIn9+		 (Sphere happy_var_2 (happy_var_4,happy_var_6,happy_var_8)+	) `HappyStk` happyRest}}}}++happyReduce_7 = happyReduce 10# 5# happyReduction_7+happyReduction_7 (happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenDouble happy_var_9) -> +	happyIn9+		 (Plane (happy_var_3,happy_var_5,happy_var_7,happy_var_9)+	) `HappyStk` happyRest}}}}++happyReduce_8 = happyReduce 9# 6# happyReduction_8+happyReduction_8 (happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenDouble happy_var_9) -> +	happyIn10+		 (perlinSolid (happy_var_3,happy_var_5,happy_var_7) happy_var_9+	) `HappyStk` happyRest}}}}++happyReduce_9 = happyReduce 10# 6# happyReduction_9+happyReduction_9 (happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenInt happy_var_9) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	happyIn10+		 (perlinSemiTurbulence (happy_var_3,happy_var_5,happy_var_7) happy_var_9 happy_var_10+	) `HappyStk` happyRest}}}}}++happyReduce_10 = happyReduce 10# 6# happyReduction_10+happyReduction_10 (happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenInt happy_var_9) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	happyIn10+		 (perlinTurbulence (happy_var_3,happy_var_5,happy_var_7) happy_var_9 happy_var_10+	) `HappyStk` happyRest}}}}}++happyReduce_11 = happyReduce 17# 6# happyReduction_11+happyReduction_11 (happy_x_17 `HappyStk`+	happy_x_16 `HappyStk`+	happy_x_15 `HappyStk`+	happy_x_14 `HappyStk`+	happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	case happyOutTok happy_x_12 of { (TokenDouble happy_var_12) -> +	case happyOutTok happy_x_14 of { (TokenDouble happy_var_14) -> +	case happyOutTok happy_x_16 of { (TokenInt happy_var_16) -> +	case happyOutTok happy_x_17 of { (TokenDouble happy_var_17) -> +	happyIn10+		 (perlinFire (happy_var_3,happy_var_5,happy_var_7) (happy_var_10,happy_var_12,happy_var_14)+										            happy_var_16 happy_var_17+	) `HappyStk` happyRest}}}}}}}}++happyReduce_12 = happySpecReduce_2  6# happyReduction_12+happyReduction_12 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_2 of { (TokenDouble happy_var_2) -> +	happyIn10+		 (perlinPlasma happy_var_2+	)}++happyReduce_13 = happyReduce 18# 6# happyReduction_13+happyReduction_13 (happy_x_18 `HappyStk`+	happy_x_17 `HappyStk`+	happy_x_16 `HappyStk`+	happy_x_15 `HappyStk`+	happy_x_14 `HappyStk`+	happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenInt happy_var_9) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	case happyOutTok happy_x_12 of { (TokenDouble happy_var_12) -> +	case happyOutTok happy_x_14 of { (TokenDouble happy_var_14) -> +	case happyOutTok happy_x_16 of { (TokenDouble happy_var_16) -> +	case happyOutTok happy_x_18 of { (TokenDouble happy_var_18) -> +	happyIn10+		 (perlinMarble (happy_var_3,happy_var_5,happy_var_7) happy_var_9 happy_var_10+										              (happy_var_12,happy_var_14,happy_var_16) happy_var_18+	) `HappyStk` happyRest}}}}}}}}}++happyReduce_14 = happyReduce 25# 6# happyReduction_14+happyReduction_14 (happy_x_25 `HappyStk`+	happy_x_24 `HappyStk`+	happy_x_23 `HappyStk`+	happy_x_22 `HappyStk`+	happy_x_21 `HappyStk`+	happy_x_20 `HappyStk`+	happy_x_19 `HappyStk`+	happy_x_18 `HappyStk`+	happy_x_17 `HappyStk`+	happy_x_16 `HappyStk`+	happy_x_15 `HappyStk`+	happy_x_14 `HappyStk`+	happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	case happyOutTok happy_x_12 of { (TokenDouble happy_var_12) -> +	case happyOutTok happy_x_14 of { (TokenDouble happy_var_14) -> +	case happyOutTok happy_x_16 of { (TokenInt happy_var_16) -> +	case happyOutTok happy_x_17 of { (TokenDouble happy_var_17) -> +	case happyOutTok happy_x_19 of { (TokenDouble happy_var_19) -> +	case happyOutTok happy_x_21 of { (TokenDouble happy_var_21) -> +	case happyOutTok happy_x_23 of { (TokenDouble happy_var_23) -> +	case happyOutTok happy_x_25 of { (TokenDouble happy_var_25) -> +	happyIn10+		 (perlinMarbleBase (happy_var_3,happy_var_5,happy_var_7)+										                  (happy_var_10,happy_var_12,happy_var_14)+                                                                                                  happy_var_16 happy_var_17+										                  (happy_var_19,happy_var_21,happy_var_23) happy_var_25+	) `HappyStk` happyRest}}}}}}}}}}}}++happyReduce_15 = happyReduce 12# 6# happyReduction_15+happyReduction_15 (happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_9 of { (TokenInt happy_var_9) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	case happyOutTok happy_x_11 of { (TokenDouble happy_var_11) -> +	case happyOutTok happy_x_12 of { (TokenDouble happy_var_12) -> +	happyIn10+		 (perlinWood (happy_var_3,happy_var_5,happy_var_7) happy_var_9 happy_var_10 happy_var_11 happy_var_12+	) `HappyStk` happyRest}}}}}}}++happyReduce_16 = happyReduce 8# 7# happyReduction_16+happyReduction_16 (happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_3 of { (TokenDouble happy_var_3) -> +	case happyOutTok happy_x_5 of { (TokenDouble happy_var_5) -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	happyIn11+		 (Solid (happy_var_3,happy_var_5,happy_var_7)+	) `HappyStk` happyRest}}}++happyReduce_17 = happyReduce 4# 7# happyReduction_17+happyReduction_17 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_3 of { happy_var_3 -> +	happyIn11+		 (Perlin happy_var_3+	) `HappyStk` happyRest}++happyReduce_18 = happyReduce 11# 8# happyReduction_18+happyReduction_18 (happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut11 happy_x_5 of { happy_var_5 -> +	case happyOutTok happy_x_7 of { (TokenDouble happy_var_7) -> +	case happyOutTok happy_x_8 of { (TokenInt happy_var_8) -> +	case happyOutTok happy_x_9 of { (TokenDouble happy_var_9) -> +	case happyOutTok happy_x_10 of { (TokenDouble happy_var_10) -> +	happyIn12+		 (Texture happy_var_5 happy_var_7 happy_var_8 happy_var_9 happy_var_10+	) `HappyStk` happyRest}}}}}++happyReduce_19 = happyReduce 7# 9# happyReduction_19+happyReduction_19 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut9 happy_x_4 of { happy_var_4 -> +	case happyOut12 happy_x_6 of { happy_var_6 -> +	happyIn13+		 ((happy_var_4,happy_var_6)+	) `HappyStk` happyRest}}++happyReduce_20 = happySpecReduce_0  10# happyReduction_20+happyReduction_20  =  happyIn14+		 ([]+	)++happyReduce_21 = happySpecReduce_2  10# happyReduction_21+happyReduction_21 happy_x_2+	happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	case happyOut13 happy_x_2 of { happy_var_2 -> +	happyIn14+		 (happy_var_2 : happy_var_1+	)}}++happyReduce_22 = happyReduce 17# 11# happyReduction_22+happyReduction_22 (happy_x_17 `HappyStk`+	happy_x_16 `HappyStk`+	happy_x_15 `HappyStk`+	happy_x_14 `HappyStk`+	happy_x_13 `HappyStk`+	happy_x_12 `HappyStk`+	happy_x_11 `HappyStk`+	happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_4 of { (TokenDouble happy_var_4) -> +	case happyOutTok happy_x_6 of { (TokenDouble happy_var_6) -> +	case happyOutTok happy_x_8 of { (TokenDouble happy_var_8) -> +	case happyOutTok happy_x_11 of { (TokenDouble happy_var_11) -> +	case happyOutTok happy_x_13 of { (TokenDouble happy_var_13) -> +	case happyOutTok happy_x_15 of { (TokenDouble happy_var_15) -> +	happyIn15+		 (PointLight (happy_var_4,happy_var_6,happy_var_8) (happy_var_11,happy_var_13,happy_var_15)+	) `HappyStk` happyRest}}}}}}++happyReduce_23 = happyReduce 10# 11# happyReduction_23+happyReduction_23 (happy_x_10 `HappyStk`+	happy_x_9 `HappyStk`+	happy_x_8 `HappyStk`+	happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_4 of { (TokenDouble happy_var_4) -> +	case happyOutTok happy_x_6 of { (TokenDouble happy_var_6) -> +	case happyOutTok happy_x_8 of { (TokenDouble happy_var_8) -> +	happyIn15+		 (AmbientLight (happy_var_4,happy_var_6,happy_var_8)+	) `HappyStk` happyRest}}}++happyReduce_24 = happySpecReduce_0  12# happyReduction_24+happyReduction_24  =  happyIn16+		 ([]+	)++happyReduce_25 = happySpecReduce_2  12# happyReduction_25+happyReduction_25 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	happyIn16+		 (happy_var_2 : happy_var_1+	)}}++happyNewToken action sts stk [] =+	happyDoAction 34# notHappyAtAll action sts stk []++happyNewToken action sts stk (tk:tks) =+	let cont i = happyDoAction i tk action sts stk tks in+	case tk of {+	TokenInt happy_dollar_dollar -> cont 1#;+	TokenDouble happy_dollar_dollar -> cont 2#;+	TokenCamera -> cont 3#;+	TokenBackground -> cont 4#;+	TokenDiff -> cont 5#;+	TokenSolid -> cont 6#;+	TokenPerlinSolid -> cont 7#;+	TokenPerlinSemiTurb -> cont 8#;+	TokenPerlinTurb -> cont 9#;+	TokenPerlinFire -> cont 10#;+	TokenPerlinPlasma -> cont 11#;+	TokenPerlinMarble -> cont 12#;+	TokenPerlinMarbleBase -> cont 13#;+	TokenPerlinWood -> cont 14#;+	TokenPerlin -> cont 15#;+	TokenTexture -> cont 16#;+	TokenSphere -> cont 17#;+	TokenPlane -> cont 18#;+	TokenTexturedObject -> cont 19#;+	TokenObjects -> cont 20#;+	TokenPointLight -> cont 21#;+	TokenAmbientLight -> cont 22#;+	TokenLights -> cont 23#;+	TokenScene -> cont 24#;+	TokenResolution -> cont 25#;+	TokenRenderDescr -> cont 26#;+	TokenOpenAcc -> cont 27#;+	TokenCloseAcc -> cont 28#;+	TokenOpenBrack -> cont 29#;+	TokenCloseBrack -> cont 30#;+	TokenOpenHook -> cont 31#;+	TokenCloseHook -> cont 32#;+	TokenComma -> cont 33#;+	_ -> happyError' (tk:tks)+	}++happyError_ tk tks = happyError' (tk:tks)++newtype HappyIdentity a = HappyIdentity a+happyIdentity = HappyIdentity+happyRunIdentity (HappyIdentity a) = a++instance Monad HappyIdentity where+    return = HappyIdentity+    (HappyIdentity p) >>= q = q p++happyThen :: () => HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b+happyThen = (>>=)+happyReturn :: () => a -> HappyIdentity a+happyReturn = (return)+happyThen1 m k tks = (>>=) m (\a -> k a tks)+happyReturn1 :: () => a -> b -> HappyIdentity a+happyReturn1 = \a tks -> (return) a+happyError' :: () => [Token] -> HappyIdentity a+happyError' = HappyIdentity . happyError++parseScene tks = happyRunIdentity happySomeParser where+  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut4 x))++happySeq = happyDontSeq+++-- representation of a full description of scene which should be rendered+data RenderDescr = RenderDescr Resolution Int Scene+++readDescr :: String -> RenderDescr+readDescr = parseScene.lexer++happyError :: [Token] -> a+happyError _ = error "Parse error ! ! !"++data Token+       = TokenInt Int+       | TokenDouble Double+       | TokenCamera+       | TokenBackground+       | TokenDiff+       | TokenSolid+       | TokenPerlinSolid+       | TokenPerlinSemiTurb+       | TokenPerlinTurb+       | TokenPerlinFire+       | TokenPerlinPlasma+       | TokenPerlinMarble+       | TokenPerlinMarbleBase+       | TokenPerlinWood+       | TokenPerlin+       | TokenTexture+       | TokenSphere+       | TokenPlane+       | TokenObjType+       | TokenTexturedObject+       | TokenObjects+       | TokenPointLight+       | TokenAmbientLight+       | TokenLight+       | TokenLights+       | TokenScene+       | TokenResolution+       | TokenRenderDescr+       | TokenOpenAcc+       | TokenCloseAcc+       | TokenOpenBrack+       | TokenCloseBrack+       | TokenOpenHook+       | TokenCloseHook+       | TokenComma++lexer :: String -> [Token]+lexer [] = []+lexer (c:cs)+      | isSpace c = lexer cs+      | isAlpha c = lexVar (c:cs)+      | isDigit c = lexNum (c:cs) 1+lexer ('{':cs) = TokenOpenAcc : lexer cs+lexer ('}':cs) = TokenCloseAcc : lexer cs+lexer ('(':cs) = TokenOpenBrack : lexer cs+lexer (')':cs) = TokenCloseBrack : lexer cs+lexer ('[':cs) = TokenOpenHook : lexer cs+lexer (']':cs) = TokenCloseHook : lexer cs+lexer (',':cs) = TokenComma : lexer cs+lexer ('-':cs) = lexNum cs (-1)++lexNum cs mul+          | (r == '.')  = TokenDouble (mul * (read (num++[r]++num2) :: Double)) : lexer rest2+          | otherwise = TokenInt (round (mul * (read num))) : lexer (r:rest)+          where (num,(r:rest)) = span isDigit cs+	        (num2,rest2)   = span isDigit rest++lexVar cs =+   case span isAlpha cs of+      ("camera",rest)            -> TokenCamera : lexer rest+      ("background",rest)        -> TokenBackground : lexer rest+      ("diff",rest)              -> TokenDiff : lexer rest+      ("solid",rest)             -> TokenSolid : lexer rest+      ("perlinSolid",rest)       -> TokenPerlinSolid : lexer rest+      ("perlinSemiTurb",rest)    -> TokenPerlinSemiTurb : lexer rest+      ("perlinTurb",rest)        -> TokenPerlinTurb : lexer rest+      ("perlinFire",rest)        -> TokenPerlinFire : lexer rest+      ("perlinPlasma",rest)      -> TokenPerlinPlasma : lexer rest+      ("perlinMarble",rest)      -> TokenPerlinMarble : lexer rest+      ("perlinMarbleBase",rest)  -> TokenPerlinMarbleBase : lexer rest+      ("perlinWood",rest)        -> TokenPerlinWood : lexer rest+      ("perlin",rest)            -> TokenPerlin : lexer rest+      ("texture",rest)           -> TokenTexture : lexer rest+      ("sphere",rest)            -> TokenSphere : lexer rest+      ("plane",rest)             -> TokenPlane : lexer rest+      ("object",rest)            -> TokenTexturedObject : lexer rest+      ("objects",rest)           -> TokenObjects : lexer rest+      ("pointLight",rest)        -> TokenPointLight : lexer rest+      ("ambientLight",rest)      -> TokenAmbientLight : lexer rest+      ("light",rest)             -> TokenLight : lexer rest+      ("lights",rest)            -> TokenLights : lexer rest+      ("scene",rest)             -> TokenScene : lexer rest+      ("resolution",rest)        -> TokenResolution : lexer rest+      ("renderDescr",rest)       -> TokenRenderDescr : lexer rest+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp ++{-# LINE 28 "templates/GenericTemplate.hs" #-}+++data Happy_IntList = HappyCons Int# Happy_IntList++++++{-# LINE 49 "templates/GenericTemplate.hs" #-}++{-# LINE 59 "templates/GenericTemplate.hs" #-}++{-# LINE 68 "templates/GenericTemplate.hs" #-}++infixr 9 `HappyStk`+data HappyStk a = HappyStk a (HappyStk a)++-----------------------------------------------------------------------------+-- starting the parse++happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll++-----------------------------------------------------------------------------+-- Accepting the parse++-- If the current token is 0#, it means we've just accepted a partial+-- parse (a %partial parser).  We must ignore the saved token on the top of+-- the stack in this case.+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =+	happyReturn1 ans+happyAccept j tk st sts (HappyStk ans _) = +	(happyTcHack j (happyTcHack st)) (happyReturn1 ans)++-----------------------------------------------------------------------------+-- Arrays only: do the next action++++happyDoAction i tk st+	= {- nothing -}+++	  case action of+		0#		  -> {- nothing -}+				     happyFail i tk st+		-1# 	  -> {- nothing -}+				     happyAccept i tk st+		n | (n <# (0# :: Int#)) -> {- nothing -}++				     (happyReduceArr ! rule) i tk st+				     where rule = (I# ((negateInt# ((n +# (1# :: Int#))))))+		n		  -> {- nothing -}+++				     happyShift new_state i tk st+				     where new_state = (n -# (1# :: Int#))+   where off    = indexShortOffAddr happyActOffsets st+	 off_i  = (off +# i)+	 check  = if (off_i >=# (0# :: Int#))+			then (indexShortOffAddr happyCheck off_i ==#  i)+			else False+ 	 action | check     = indexShortOffAddr happyTable off_i+		| otherwise = indexShortOffAddr happyDefActions st++{-# LINE 127 "templates/GenericTemplate.hs" #-}+++indexShortOffAddr (HappyA# arr) off =+#if __GLASGOW_HASKELL__ > 500+	narrow16Int# i+#elif __GLASGOW_HASKELL__ == 500+	intToInt16# i+#else+	(i `iShiftL#` 16#) `iShiftRA#` 16#+#endif+  where+#if __GLASGOW_HASKELL__ >= 503+	i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)+#else+	i = word2Int# ((high `shiftL#` 8#) `or#` low)+#endif+	high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+	low  = int2Word# (ord# (indexCharOffAddr# arr off'))+	off' = off *# 2#++++++data HappyAddr = HappyA# Addr#+++++-----------------------------------------------------------------------------+-- HappyState data type (not arrays)++{-# LINE 170 "templates/GenericTemplate.hs" #-}++-----------------------------------------------------------------------------+-- Shifting a token++happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =+     let i = (case unsafeCoerce# x of { (I# (i)) -> i }) in+--     trace "shifting the error token" $+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)++happyShift new_state i tk st sts stk =+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)++-- happyReduce is specialised for the common cases.++happySpecReduce_0 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_0 nt fn j tk st@((action)) sts stk+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)++happySpecReduce_1 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')+     = let r = fn v1 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_2 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')+     = let r = fn v1 v2 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_3 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')+     = let r = fn v1 v2 v3 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happyReduce k i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyReduce k nt fn j tk st sts stk+     = case happyDrop (k -# (1# :: Int#)) sts of+	 sts1@((HappyCons (st1@(action)) (_))) ->+        	let r = fn stk in  -- it doesn't hurt to always seq here...+       		happyDoSeq r (happyGoto nt j tk st1 sts1 r)++happyMonadReduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonadReduce k nt fn j tk st sts stk =+        happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++happyMonad2Reduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonad2Reduce k nt fn j tk st sts stk =+       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++             off    = indexShortOffAddr happyGotoOffsets st1+             off_i  = (off +# nt)+             new_state = indexShortOffAddr happyTable off_i+++++happyDrop 0# l = l+happyDrop n (HappyCons (_) (t)) = happyDrop (n -# (1# :: Int#)) t++happyDropStk 0# l = l+happyDropStk n (x `HappyStk` xs) = happyDropStk (n -# (1#::Int#)) xs++-----------------------------------------------------------------------------+-- Moving to a new state after a reduction+++happyGoto nt j tk st = +   {- nothing -}+   happyDoAction j tk new_state+   where off    = indexShortOffAddr happyGotoOffsets st+	 off_i  = (off +# nt)+ 	 new_state = indexShortOffAddr happyTable off_i+++++-----------------------------------------------------------------------------+-- Error recovery (0# is the error token)++-- parse error if we are in recovery and we fail again+happyFail  0# tk old_st _ stk =+--	trace "failing" $ +    	happyError_ tk++{-  We don't need state discarding for our restricted implementation of+    "error".  In fact, it can cause some bogus parses, so I've disabled it+    for now --SDM++-- discard a state+happyFail  0# tk old_st (HappyCons ((action)) (sts)) +						(saved_tok `HappyStk` _ `HappyStk` stk) =+--	trace ("discarding state, depth " ++ show (length stk))  $+	happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+-}++-- Enter error recovery: generate an error token,+--                       save the old token and carry on.+happyFail  i tk (action) sts stk =+--      trace "entering error recovery" $+	happyDoAction 0# tk action sts ( (unsafeCoerce# (I# (i))) `HappyStk` stk)++-- Internal happy errors:++notHappyAtAll = error "Internal Happy error\n"++-----------------------------------------------------------------------------+-- Hack to get the typechecker to accept our action functions+++happyTcHack :: Int# -> a -> a+happyTcHack x y = y+{-# INLINE happyTcHack #-}+++-----------------------------------------------------------------------------+-- Seq-ing.  If the --strict flag is given, then Happy emits +--	happySeq = happyDoSeq+-- otherwise it emits+-- 	happySeq = happyDontSeq++happyDoSeq, happyDontSeq :: a -> b -> b+happyDoSeq   a b = a `seq` b+happyDontSeq a b = b++-----------------------------------------------------------------------------+-- Don't inline any functions from the template.  GHC has a nasty habit+-- of deciding to inline happyGoto everywhere, which increases the size of+-- the generated parser quite a bit.+++{-# NOINLINE happyDoAction #-}+{-# NOINLINE happyTable #-}+{-# NOINLINE happyCheck #-}+{-# NOINLINE happyActOffsets #-}+{-# NOINLINE happyGotoOffsets #-}+{-# NOINLINE happyDefActions #-}++{-# NOINLINE happyShift #-}+{-# NOINLINE happySpecReduce_0 #-}+{-# NOINLINE happySpecReduce_1 #-}+{-# NOINLINE happySpecReduce_2 #-}+{-# NOINLINE happySpecReduce_3 #-}+{-# NOINLINE happyReduce #-}+{-# NOINLINE happyMonadReduce #-}+{-# NOINLINE happyGoto #-}+{-# NOINLINE happyFail #-}++-- end of Happy Template.
+ readme.txt view
@@ -0,0 +1,23 @@+HRay - a Haskell ray tracer+:==========================:++Command line interface:+-----------------------++To compile the command line interface with GHC:++ghc --make -O HRayMain -o HRay.exe++To run the progrma, execute HRay.exe !++Graphical user interface:+-----------------------++To compile the graphical user interface with GHC:++ghc --make -O HRayGUI -o HRayGUI.exe++To run the progrma, execute HRayGUI.exe !++Note: please make sure you have gtk2hs 0.9.7 (http://haskell.org/gtk2hs/)+installed an your system, together with the last release of Gtk+ (www.gtk.org). 
+ scenes/circles.hry view
@@ -0,0 +1,14 @@+renderDescr ( resolution (800,600) ) 3 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( plane (0.0,10.0,1.0,550.0) ) ( texture ( diff solid (0.8,0.8,0.8) ) 1.0 60 0.0 0.0 ))+                (object ( sphere 15.0 (0.0,55.0,-300.0) ) ( texture ( diff solid (0.8,0.0,0.0) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (35.35,45.23,-285.35) ) ( texture ( diff solid (0.0,0.7,0.0) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (50.0,21.66,-250.0) ) ( texture ( diff solid (0.0,0.0,0.9) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (35.35,-5.0,-214.65) ) ( texture ( diff solid (0.9,0.7,0.9) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (0.0,-15.0,-200.0) ) ( texture ( diff solid (0.2,0.2,0.2) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (-50.0,21.66,-250.0) ) ( texture ( diff solid (0.36,0.75,0.9) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (-35.35,-5.0,-214.65) ) ( texture ( diff solid (0.98,0.36,0.89) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (-35.35,45.23,-285.35) ) ( texture ( diff solid (1.0,0.7,0.0) ) 0.8 60 0.0 0.0 )) }+      { lights (pointLight (30.0,0.0,100.0) (0.5,0.5,0.5) )+	       (pointLight (-30.0,0.0,100.0) (0.5,0.5,0.5) ) } ]
+ scenes/mirror.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (1024,783) ) 10 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( plane (1.0,0.0,-1.0,200.0) ) ( texture ( diff solid (0.0,0.0,0.4) ) 0.3 60 0.0 0.0 ))+		(object ( plane (-1.0,0.0,-1.0,200.0) ) ( texture ( diff solid (0.4,0.0,0.0) ) 0.8 30 0.0 0.0 ))+                (object ( sphere 30.0 (-20.0,20.0,130.0) ) ( texture ( diff solid (1.0,0.7,0.0) ) 0.8 60 0.0 0.0 ))+                (object ( sphere 15.0 (30.0,-10.0,100.0) ) ( texture ( diff solid (0.9,0.9,0.8) ) 0.6 20 0.0 0.0 )) +                (object ( sphere 5.0 (-5.0,-30.0,110.0) ) ( texture ( diff solid (0.0,0.8,0.0) ) 0.4 40 0.0 0.0 )) }+      { lights (pointLight (30.0,0.0,-300.0) (0.5,0.5,0.5) )+	       (pointLight (-30.0,0.0,-300.0) (0.5,0.5,0.5) ) } ]
+ scenes/perlin0.hry view
@@ -0,0 +1,20 @@+renderDescr ( resolution (800,600) ) 2 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 150.0 (0.0,0.0,-500.0) ) +			( texture ( diff perlin ( perlinFire (1.0,0.5,0.5) (0.0,1.0,0.0) 10 64.0)) 0.0 200 0.0 0.0 ))+		(object ( sphere 40.0 (-80.0,0.0,-380.0) ) +			( texture ( diff perlin (perlinPlasma 16.0)) 0.0 60 0.0 0.0 ))+		(object ( sphere 30.0 (100.0,30.0,-350.0) ) +			( texture ( diff perlin (perlinMarble (0.0,0.5,0.5) 10 64.0 (0.4,0.0,0.0) 30.0)) 0.0 60 0.0 0.0 ))+		(object ( sphere 20.0 (40.0,60.0,-300.0) )+			( texture ( diff perlin (perlinSolid (0.0,0.9,0.0) 2.0)) 0.0 60 0.0 0.0 )) +		(object ( sphere 20.0 (-40.0,80.0,-300.0) ) +			( texture ( diff perlin (perlinMarbleBase (0.8,0.0,0.0) (0.3,0.3,0.0) 10 32.0 (0.4,0.0,0.0) 30.0)) 0.0 60 0.0 0.0 ))+		(object ( sphere 30.0 (10.0,-40.0,-300.0) ) +			( texture ( diff perlin (perlinWood (0.51,0.33,0.03) 10 16.0 1.0 2.0)) 0.0 60 0.0 0.0 )) }++      { lights  (pointLight (200.0,200.0,200.0) (0.7,0.7,0.7) ) +		(pointLight (-200.0,-100.0,200.0) (0.4,0.4,0.4) ) } ]++   
+ scenes/perlin1.hry view
@@ -0,0 +1,9 @@+renderDescr ( resolution (200,150) ) 2 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( plane (0.0,0.0,1.0,350.0) ) +			( texture ( diff perlin (perlinMarbleBase (1.0,0.5,1.0) (0.1,1.0,0.1) 10 32.0 (0.2,0.3,0.0) 20.0)) 0.0 60 0.0 0.0 ))}+      { lights  (pointLight (200.0,200.0,200.0) (0.7,0.7,0.7) ) +		(pointLight (-200.0,-100.0,200.0) (0.4,0.4,0.4) ) } ]++   
+ scenes/perlinShowFire.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinFire (0.2,0.2,0.2) (0.4,0.4,0.4) 10 8.0)) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinFire (0.4,0.4,0.4) (0.4,0.4,0.4) 10 4.0)) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowMarble.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinMarble (0.4,0.4,0.4) 10 64.0 (0.4,0.0,0.0) 30.0 )) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinMarble (0.6,0.6,0.6) 10 32.0 (0.4,0.0,0.0) 30.0 )) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowMarbleBase.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinMarbleBase (0.4,0.4,0.4) (0.4,0.4,0.4) 10 64.0 (0.4,0.0,0.0) 30.0 )) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinMarbleBase (0.6,0.6,0.6) (0.4,0.4,0.4) 10 32.0 (0.4,0.0,0.0) 30.0 )) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowPlasma.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinPlasma 16.0 )) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinPlasma 8.0 )) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowSemiTurb.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinSemiTurb (0.8,0.8,0.8) 10 8.0)) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinSemiTurb (1.0,1.0,1.0) 10 4.0)) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowSolid.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinSolid (0.8,0.8,0.8) 8.0)) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinSolid (1.0,1.0,1.0) 4.0)) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowTurb.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinTurb (0.8,0.8,0.8) 10 8.0)) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinTurb (1.0,1.0,1.0) 10 4.0)) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/perlinShowWood.hry view
@@ -0,0 +1,10 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,-150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 40.0 (20.0,20.0,100.0) ) +			( texture ( diff perlin (perlinWood (0.4,0.4,0.4) 10 20.0 0.8 2.0)) 0.0 0 0.0 0.0 )) +		(object ( sphere 25.0 (-40.0,-30.0,120.0) ) +			( texture ( diff perlin (perlinWood (0.6,0.6,0.6) 10 16.0 1.0 2.0)) 0.7 60 0.0 0.0 )) }+      { lights (pointLight (0.0,0.0,-200.0) (1.0,1.0,1.0) ) } ]++   
+ scenes/shadow0.hry view
@@ -0,0 +1,7 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 10.0 (-30.0,-20.0,-90.0) ) ( texture ( diff solid (0.8,0.0,0.0) ) 0.0 0 0.0 0.0))+		(object ( sphere 40.0 (10.0,0.0,-150.0) ) ( texture ( diff solid (0.0,0.0,0.8) ) 0.0 0 0.0 0.0)) }+      { lights (pointLight (-60.0,-50.0,0.0) (1.0,1.0,1.0) ) } ]+               
+ scenes/shadow1.hry view
@@ -0,0 +1,7 @@+renderDescr ( resolution (400,300) ) 2 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 10.0 (-20.0,-20.0,-80.0) ) ( texture ( diff solid (0.8,0.0,0.0) ) 0.0 0 0.0 0.0))+		(object ( sphere 40.0 (10.0,0.0,-150.0) ) ( texture ( diff solid (0.0,0.0,0.8) ) 0.0 0 0.0 0.0)) }+      { lights (pointLight (-60.0,-50.0,0.0) (1.0,1.0,1.0) ) } ]+               
+ scenes/shadow2.hry view
@@ -0,0 +1,7 @@+renderDescr ( resolution (800,600) ) 0 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 10.0 (-10.0,-20.0,-70.0) ) ( texture ( diff solid (0.8,0.0,0.0) ) 0.0 0 0.0 0.0))+		(object ( sphere 40.0 (10.0,0.0,-150.0) ) ( texture ( diff solid (0.0,0.0,0.8) ) 0.0 0 0.0 0.0)) }+      { lights (pointLight (-60.0,-50.0,0.0) (1.0,1.0,1.0) ) } ]+               
+ scenes/trans0.hry view
@@ -0,0 +1,8 @@+renderDescr ( resolution (800,600) ) 100 [+scene { camera (0.0,0.0,300.0) (200,150) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 80.0 (60.0,60.0,-400.0) ) ( texture ( diff solid (0.0,1.0,0.0) ) 1.0 20 0.0 0.0 )) +		(object ( sphere 80.0 (10.0,-20.0,-200.0) ) ( texture ( diff solid (0.6,0.6,1.0) ) 0.0 20 0.8 1.3 )) }+      { lights 	(pointLight (100.0,200.0,-300.0) (0.7,0.7,0.7) )+	       	(pointLight (50.0,-200.0,-300.0) (0.7,0.7,0.7) )+	       	(pointLight (-150.0,-100.0,300.0) (0.7,0.7,0.7) ) } ]
+ scenes/trans1.hry view
@@ -0,0 +1,18 @@+renderDescr ( resolution (400,300) ) 10 [+scene { camera (0.0,0.0,300.0) (200,150) } +      { background (0.8,0.8,0.8) } +      { objects (object ( sphere 30.0 (105.0,75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (35.0,75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-35.0,75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-105.0,75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (105.0,0.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (35.0,0.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-35.0,0.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-105.0,0.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (105.0,-75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (35.0,-75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-35.0,-75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 30.0 (-105.0,-75.0,-350.0) ) ( texture ( diff solid (1.0,0.0,0.0) ) 0.0 20 0.0 0.0 ))+		(object ( sphere 80.0 (0.0,0.0,-150.0) ) ( texture ( diff solid (0.0,0.0,1.0) ) 0.0 0 0.8 1.2 )) }+      { lights (pointLight (-200.0,0.0,500.0) (0.7,0.7,0.7) ) +	       (pointLight (0.0,0.0,-250.0) (0.5,0.5,0.5) ) } ]
+ scenes/trans2.hry view
@@ -0,0 +1,12 @@+renderDescr ( resolution (800,600) ) 3 [+scene { camera (0.0,0.0,150.0) (100,75) } +      { background (0.0,0.0,0.0) } +      { objects (object ( plane (0.0,0.0,1.0,350.0) ) +			( texture ( diff perlin (perlinMarbleBase (1.0,0.5,1.0) (0.1,1.0,0.1) 10 32.0 (0.2,0.3,0.0) 20.0)) 0.7 60 0.0 0.0 ))+		(object ( sphere 45.0 (30.0,20.0,-150.0) ) +			( texture ( diff perlin (perlinWood (0.51,0.33,0.03) 10 16.0 1.0 2.0)) 0.2 60 0.5 1.1 ))+			+		(object ( sphere 20.0 (30.0,-50.0,-150.0) ) ( texture ( diff solid (0.8,0.0,0.0) ) 0.0 20 0.8 1.12 ))+		(object ( sphere 30.0 (-50.0,30.0,-150.0) ) ( texture ( diff solid (0.0,0.0,1.0) ) 1.0 20 0.6 1.17 )) }+      { lights (pointLight (0.0,0.0,-250.0) (0.5,0.5,0.5) )+	       (pointLight (200.0,100.0,100.0) (0.5,0.5,0.5) ) } ]