Пример #1
0
        private void LeftFace(float smovy, float tsper, float tsperh, float light, int j, int i, float smovx, int k)
        {
//left face
            VertexArray[index] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 1 + sy * dimS, -k),
                    Vector3.Left, new Vector2(smovx + tsper, smovy), light * 0.8f);
            VertexArray[index + 1] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 1 + sy * dimS, -k - 1),
                    Vector3.Left, new Vector2(smovx + tsper, smovy + tsperh), light * 0.8f);
            VertexArray[index + 2] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + sy * dimS, -k - 1),
                    Vector3.Left, new Vector2(smovx, smovy + tsperh), light * 0.8f);
            VertexArray[index + 3] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + sy * dimS, -k - 1),
                    Vector3.Left, new Vector2(smovx, smovy + tsperh), light * 0.8f);
            VertexArray[index + 4] =
                new VertexPositionNormalTextureShade(new Vector3(i + 1 + sx * dimS, j + sy * dimS, -k),
                                                     Vector3.Left, new Vector2(smovx, smovy),
                                                     light * 0.8f);
            VertexArray[index + 5] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 1 + sy * dimS, -k),
                    Vector3.Left, new Vector2(smovx + tsper, smovy), light * 0.8f);

            index += 6;
        }
Пример #2
0
        private void DownFaceTree(float light, float tsper, float tsperh, int i, int j, int k, float smovx, float smovy)
        {
//Backward face
            VertexArrayTransparent[indextransparent] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 0.499f + sy * dimS, -k + 1),
                    Vector3.Down, new Vector2(smovx, smovy), light);
            VertexArrayTransparent[indextransparent + 1] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + sx * dimS, j + 0.499f + sy * dimS, -k + 1),
                    Vector3.Down,
                    new Vector2(smovx + tsper, smovy), light);
            VertexArrayTransparent[indextransparent + 2] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + sx * dimS, j + 0.499f + sy * dimS, -k - 1),
                    Vector3.Down,
                    new Vector2(smovx + tsper, smovy + tsperh), light);
            VertexArrayTransparent[indextransparent + 3] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + sx * dimS, j + 0.499f + sy * dimS, -k - 1),
                    Vector3.Down,
                    new Vector2(smovx + tsper, smovy + tsperh), light);
            VertexArrayTransparent[indextransparent + 4] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 0.499f + sy * dimS, -k - 1),
                    Vector3.Down, new Vector2(smovx, smovy + tsperh), light);
            VertexArrayTransparent[indextransparent + 5] =
                new VertexPositionNormalTextureShade(
                    new Vector3(i + 1 + sx * dimS, j + 0.499f + sy * dimS, -k + 1),
                    Vector3.Down, new Vector2(smovx, smovy), light);
            indextransparent += 6;
        }
Пример #3
0
        private void ForwardFaceBlack(float umovy, float tsperh, float tsper, float umovx, int i, int j, int k)
        {
            VertexArray[index] =
                new VertexPositionNormalTextureShade(new Vector3(i + sx * dimS, j + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx, umovy), 0);
            VertexArray[index + 1] =
                new VertexPositionNormalTextureShade(new Vector3(i + sx * dimS, j + 1 + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx, umovy + tsperh), 0);
            VertexArray[index + 2] =
                new VertexPositionNormalTextureShade(new Vector3(i + 1 + sx * dimS, j + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx + tsper, umovy), 0);
            VertexArray[index + 3] =
                new VertexPositionNormalTextureShade(new Vector3(i + 1 + sx * dimS, j + 1 + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx + tsper, umovy + tsperh), 0);
            VertexArray[index + 4] =
                new VertexPositionNormalTextureShade(new Vector3(i + 1 + sx * dimS, j + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx + tsper, umovy), 0);
            VertexArray[index + 5] =
                new VertexPositionNormalTextureShade(new Vector3(i + sx * dimS, j + 1 + sy * dimS, -k),
                                                     Vector3.Backward,
                                                     new Vector2(umovx, umovy + tsperh), 0);

            index += 6;
        }
Пример #4
0
        public LocalUnits(GraphicsDevice gd, Texture2D tex)
        {
            be = new BasicEffect(gd);
            be.TextureEnabled = true;
            be.Texture        = tex;

            verts[0] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(0, 0), 1);
            verts[1] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(1, 0), 1);
            verts[2] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(0, 1), 1);

            verts[3] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(0, 1), 1);
            verts[4] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(1, 0), 1);
            verts[5] = new VertexPositionNormalTextureShade(new Vector3(), Vector3.One, new Vector2(1, 1), 1);
        }