Added better lighning and material
This commit is contained in:
parent
283da1b418
commit
cbb730e254
2 changed files with 13 additions and 6 deletions
|
@ -152,13 +152,13 @@ Here is our initial world state.
|
|||
> -- And the shape function
|
||||
> initialWorld :: World
|
||||
> initialWorld = World {
|
||||
> angle = makePoint3D (-30,0,0)
|
||||
> angle = makePoint3D (-30,-30,0)
|
||||
> , position = makePoint3D (0,0,0)
|
||||
> , scale = 0.8
|
||||
> , shape = shapeFunc
|
||||
> , box = Box3D { minPoint = makePoint3D (-2,-2,-2)
|
||||
> , maxPoint = makePoint3D (2,2,2)
|
||||
> , resolution = 0.2 }
|
||||
> , resolution = 0.16 }
|
||||
> , told = 0
|
||||
> }
|
||||
|
||||
|
|
|
@ -217,10 +217,17 @@ yMainLoop inputActionMap
|
|||
displayCallback $= display worldRef
|
||||
-- Lights
|
||||
lighting $= Enabled
|
||||
ambient (Light 1) $= Color4 0.99 0.98 0.62 1
|
||||
diffuse (Light 1) $= Color4 0.99 0.98 0.62 1
|
||||
position (Light 1) $= Vertex4 0 0 1 0.1
|
||||
light (Light 1) $= Enabled
|
||||
ambient (Light 0) $= Color4 0 0 0 1
|
||||
diffuse (Light 0) $= Color4 1 1 1 1
|
||||
specular (Light 0) $= Color4 1 1 1 1
|
||||
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
|
||||
mainLoop
|
||||
|
||||
|
|
Loading…
Reference in a new issue