Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub GlControl1_Paint(sender As Object, e As PaintEventArgs) Handles GlControl1.Paint
- ' render graphics
- GL.Clear(ClearBufferMask.ColorBufferBit Or ClearBufferMask.DepthBufferBit)
- 'Basic Setup for viewing
- Dim perspective As Matrix4 = Matrix4.CreatePerspectiveFieldOfView(1, 1, 1, 10000) 'Setup Perspective
- Dim lookat As Matrix4 = Matrix4.LookAt(0, 0, 150, 0, 0, 0, 0, 1, 0) 'Setup camera
- GL.MatrixMode(MatrixMode.Projection) 'Load Perspective
- GL.LoadIdentity()
- GL.LoadMatrix(perspective)
- GL.MatrixMode(MatrixMode.Modelview) 'Load Camera
- GL.LoadIdentity()
- GL.LoadMatrix(lookat)
- GL.Viewport(0, 0, GlControl1.Width, GlControl1.Height) 'Size of window
- GL.Enable(EnableCap.DepthTest) 'Enable correct Z Drawings
- GL.DepthFunc(DepthFunction.Less) 'Enable correct Z Drawings
- ' GL.Rotate(mousepos.X, 0, 1, 0)
- ' GL.Rotate(mousepos.Y, 0, 0, 1)
- 'Rotating
- 'GL.Rotate(100, 1, 0, 0)
- 'GL.Rotate(20, 0, 1, 0)
- 'GL.Rotate(173, 0, 0, 0)
- GL.Translate(New Vector3(-64, -64, 0))
- GL.Begin(PrimitiveType.Points)
- For Each p In Map_Loaded
- If p.height > 5 Then
- GL.Color3(Color.FromArgb(0, 255 - p.height, 0))
- GL.Vertex3(p.x, p.y, p.height / 5)
- Else
- GL.Color3(Color.FromArgb(0, 0, 100))
- GL.Vertex3(p.x, p.y, 0)
- End If
- Next
- GL.[End]()
- GlControl1.SwapBuffers()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement