Added better lighning and material

This commit is contained in:
Yann Esposito (Yogsototh) 2012-05-23 23:36:46 +02:00
parent 283da1b418
commit cbb730e254
2 changed files with 13 additions and 6 deletions

View file

@ -152,13 +152,13 @@ Here is our initial world state.
> -- And the shape function > -- And the shape function
> initialWorld :: World > initialWorld :: World
> initialWorld = World { > initialWorld = World {
> angle = makePoint3D (-30,0,0) > angle = makePoint3D (-30,-30,0)
> , position = makePoint3D (0,0,0) > , position = makePoint3D (0,0,0)
> , scale = 0.8 > , scale = 0.8
> , shape = shapeFunc > , shape = shapeFunc
> , box = Box3D { minPoint = makePoint3D (-2,-2,-2) > , box = Box3D { minPoint = makePoint3D (-2,-2,-2)
> , maxPoint = makePoint3D (2,2,2) > , maxPoint = makePoint3D (2,2,2)
> , resolution = 0.2 } > , resolution = 0.16 }
> , told = 0 > , told = 0
> } > }

View file

@ -217,10 +217,17 @@ yMainLoop inputActionMap
displayCallback $= display worldRef displayCallback $= display worldRef
-- Lights -- Lights
lighting $= Enabled lighting $= Enabled
ambient (Light 1) $= Color4 0.99 0.98 0.62 1 ambient (Light 0) $= Color4 0 0 0 1
diffuse (Light 1) $= Color4 0.99 0.98 0.62 1 diffuse (Light 0) $= Color4 1 1 1 1
position (Light 1) $= Vertex4 0 0 1 0.1 specular (Light 0) $= Color4 1 1 1 1
light (Light 1) $= Enabled position (Light 0) $= Vertex4 1 1 0 1
light (Light 0) $= Enabled
colorMaterial $= Just (Front,AmbientAndDiffuse)
materialDiffuse Front $= Color4 0.5 0.5 0.5 1
materialAmbient Front $= Color4 0.5 0.5 0.5 1
materialSpecular Front $= Color4 0.2 0.2 0.2 1
materialEmission Front $= Color4 0.3 0.3 0.3 1
materialShininess Front $= 50.0
-- We enter the main loop -- We enter the main loop
mainLoop mainLoop