diff options
author | Treeki <treeki@gmail.com> | 2011-03-08 05:17:56 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-08 05:17:56 +0100 |
commit | 7d391e33a0b3d9793c95fce832abb2c6d9002186 (patch) | |
tree | 075f8ec6272ad3ea12be44a8c2083f89b0d55228 /TestApp/RenderWindow.cs | |
parent | e962fd89af865d6e01522e9752f5fbd855ce128a (diff) | |
download | nw4rtools-7d391e33a0b3d9793c95fce832abb2c6d9002186.tar.gz nw4rtools-7d391e33a0b3d9793c95fce832abb2c6d9002186.zip |
late night commit! obj importer is basic but working. also, tidied up DL stuff
Diffstat (limited to '')
-rw-r--r-- | TestApp/RenderWindow.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/TestApp/RenderWindow.cs b/TestApp/RenderWindow.cs index 2f29d0f..6013724 100644 --- a/TestApp/RenderWindow.cs +++ b/TestApp/RenderWindow.cs @@ -27,6 +27,22 @@ namespace TestApp { GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); + GL.Disable(EnableCap.CullFace); + + GL.Enable(EnableCap.Lighting); + + GL.ShadeModel(ShadingModel.Smooth); + + GL.Light(LightName.Light0, LightParameter.Position, new Vector4(0, 500, 1000, 0)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Specular, new Color4(1, 1, 1, 1)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Shininess, 50); + GL.Enable(EnableCap.Light0); + + GL.Light(LightName.Light1, LightParameter.Position, new Vector4(1000, 500, 0, 0)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Specular, new Color4(1, 1, 1, 1)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Shininess, 50); + GL.Enable(EnableCap.Light1); + m_glModel.Prepare(Context); } @@ -45,8 +61,8 @@ namespace TestApp { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); - //Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 600, 1000), new Vector3(1000, 0, 0), Vector3.UnitY); - Matrix4 modelview = Matrix4.LookAt(new Vector3(0, 2, 4), new Vector3(0, 0, 0), Vector3.UnitY); + Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 400, 1000), new Vector3(1000, 0, 0), Vector3.UnitY); + //Matrix4 modelview = Matrix4.LookAt(new Vector3(-3, 2, 3), new Vector3(0, 0, 0), Vector3.UnitY); GL.MatrixMode(MatrixMode.Modelview); GL.LoadMatrix(ref modelview); |