예제 #1
0
        private void RenderScene()
        {
            mouseClicked = false;

            Vector3 lowerLeft = new Vector3(1.0f, graphicsUtility.viewPort.Height - 1, 0.0f);
            Vector3 ch        = graphicsUtility.UnProject(lowerLeft);

            GL.Translate(ch.X, ch.Y, 0.0);
            GL.PushMatrix();

            Vector3 pm = graphicsUtility.UnProject(mouse);

            GL.Begin(PrimitiveType.Points);
            GL.Color3(Color.Silver);
            GL.PointSize(5.0f);
            GL.Vertex3(pm.X, pm.Y, pm.Z);
            GL.End();

            graphicsUtility.CrossHair(pm);

            //PointF pp = new PointF(pm.X, pm.Y);
            graphicsUtility.BoxRectangle(pm, 0.25f, Color.Red);

            entity.Render(graphicsUtility);

            GL.PopMatrix();

            //GL.Begin(BeginMode.Quads);

            /*   GL.Begin(PrimitiveType.Quads);
             *
             * GL.Color3(Color.Silver);
             * GL.Vertex3(-1.0f, -1.0f, -1.0f);
             * GL.Vertex3(-1.0f, 1.0f, -1.0f);
             * GL.Vertex3(1.0f, 1.0f, -1.0f);
             * GL.Vertex3(1.0f, -1.0f, -1.0f);
             *
             * GL.Color3(Color.Honeydew);
             * GL.Vertex3(-1.0f, -1.0f, -1.0f);
             * GL.Vertex3(1.0f, -1.0f, -1.0f);
             * GL.Vertex3(1.0f, -1.0f, 1.0f);
             * GL.Vertex3(-1.0f, -1.0f, 1.0f);
             *
             * GL.Color3(Color.Moccasin);
             * GL.Vertex3(-1.0f, -1.0f, -1.0f);
             * GL.Vertex3(-1.0f, -1.0f, 1.0f);
             * GL.Vertex3(-1.0f, 1.0f, 1.0f);
             * GL.Vertex3(-1.0f, 1.0f, -1.0f);*/

            /*GL.Color3(Color.IndianRed);
             * GL.Vertex3(-1.0f, -1.0f, 1.0f);
             * GL.Vertex3(1.0f, -1.0f, 1.0f);
             * GL.Vertex3(1.0f, 1.0f, 1.0f);
             * GL.Vertex3(-1.0f, 1.0f, 1.0f);*/
            //graphics.BoxRectangle(Color.Blue);

            /* GL.Begin(PrimitiveType.Quads);
             *
             * GL.Color3(Color.PaleVioletRed);
             * GL.Vertex3(-1.0f, 1.0f, -1.0f);
             * GL.Vertex3(-1.0f, 1.0f, 1.0f);
             * GL.Vertex3(1.0f, 1.0f, 1.0f);
             * GL.Vertex3(1.0f, 1.0f, -1.0f);
             *
             * GL.Color3(Color.ForestGreen);
             * GL.Vertex3(1.0f, -1.0f, -1.0f);
             * GL.Vertex3(1.0f, 1.0f, -1.0f);
             * GL.Vertex3(1.0f, 1.0f, 1.0f);
             * GL.Vertex3(1.0f, -1.0f, 1.0f);
             *
             * GL.End();*/
        }