Example #1
0
 public Polygon_Tree_Node(Polygon poly)
 {
     polygon = poly;
     left_part_start_normal = -1;
     left_part_end_normal = -1;
     right_part_end_normal = -1;
 }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        /// 
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            General_VPC_Buffer.device = GraphicsDevice;
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("SpriteFont1");
            World_Effect = Content.Load<Effect>("World_Effect").Clone();
            World_Effect.Parameters["World"].SetValue(Matrix.Identity);
            World_Effect.Parameters["View"].SetValue(Matrix.CreateLookAt(new Vector3(0, 0, -10), new Vector3(0, 0, 0), new Vector3(0, 1, 0)));
            World_Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographic(-10, 10, 6, 1000));
            GraphicsDevice.BlendState = BlendState.Additive;

            GraphicsDevice.RasterizerState = RasterizerState.CullNone;

            poly = new Polygon();
            List<Vector3> points;

            points = new List<Vector3>();
            //points.Add(new Vector3(1, 1, 0));
            //points.Add(new Vector3(-1, 1, 0));
            //points.Add(new Vector3(-1, -1, 0));
            //points.Add(new Vector3(1, -1, 0));

            points.Add(new Vector3(1, 1, 0));
            points.Add(new Vector3(0.5f, 1.5f, 0));
            points.Add(new Vector3(-0.5f, 1.5f, 0));
            points.Add(new Vector3(-1, 1, 0));
            points.Add(new Vector3(-1, -1, 0));
            points.Add(new Vector3(-0.5f, -1.5f, 0));
            points.Add(new Vector3(0.5f, -1.5f, 0));
            points.Add(new Vector3(1, -1, 0));

            poly.Set(points);
        }