Пример #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.SkyBlue);

            // Draw the world.
            sceneRenderer.Begin(camera);
            world.Draw(sceneRenderer);
            sceneRenderer.End();

            base.Draw(gameTime);
        }
Пример #2
0
        protected void DrawCylinder(IList <Point3D> points, float height, float radius)
        {
            float y1 = 0.0f;
            float y2 = y1 + height;

            fScene.BeginTriangleStrip();
            for (int j = 0; j < points.Count; ++j)
            {
                var pt = points[j];

                fScene.Normal3f(pt.X / radius, 0.0f, pt.Z / radius);
                fScene.Vertex3f(pt.X, y1, pt.Z);

                fScene.Normal3f(pt.X / radius, 0.0f, pt.Z / radius);
                fScene.Vertex3f(pt.X, y2, pt.Z);
            }
            fScene.End();
        }