예제 #1
0
        void DrawSpriteXZ(float x, float y, float z, float w, float h, int image, int uv_x, int uv_y, int uv_w, int uv_h, int image_wh_size)
        {
            var v4 = new DX.VERTEX3D[6];

            //var w = 10;
            v4[0].pos = DX.VGet(x, y, z + w);
            v4[1].pos = DX.VGet(x + w, y, z + w);
            v4[2].pos = DX.VGet(x + w, y, z);
            v4[3].pos = DX.VGet(x, y, z + w);
            v4[4].pos = DX.VGet(x, y, z);
            v4[5].pos = DX.VGet(x + w, y, z);
            SetupV4(ref v4, uv_x, uv_y, uv_w, uv_h, image_wh_size);

            DX.DrawPolygon3D(out v4[0], 2, image, DX.TRUE);
        }
예제 #2
0
        // dir 0:下 1:右 2:上 3:左 (反時計回り)
        void DrawSpriteWall(int dir, float x, float y, float z, float w, float h, int image, int uv_x, int uv_y, int uv_w, int uv_h, int image_wh_size)
        {
            var v4 = new DX.VERTEX3D[6];

            //var w = 10;
            switch (dir)
            {
            default:
                v4[0].pos = DX.VGet(x, y + h, z);
                v4[1].pos = DX.VGet(x + w, y + h, z);
                v4[2].pos = DX.VGet(x + w, y, z);
                v4[3].pos = DX.VGet(x, y + h, z);
                v4[4].pos = DX.VGet(x, y, z);
                v4[5].pos = DX.VGet(x + w, y, z);
                break;

            case 1:
                v4[0].pos = DX.VGet(x, y + h, z);
                v4[1].pos = DX.VGet(x, y + h, z + w);
                v4[2].pos = DX.VGet(x, y, z + w);
                v4[3].pos = DX.VGet(x, y + h, z);
                v4[4].pos = DX.VGet(x, y, z);
                v4[5].pos = DX.VGet(x, y, z + w);
                break;

            case 2:
                v4[0].pos = DX.VGet(x, y + h, z);
                v4[1].pos = DX.VGet(x - w, y + h, z);
                v4[2].pos = DX.VGet(x - w, y, z);
                v4[3].pos = DX.VGet(x, y + h, z);
                v4[4].pos = DX.VGet(x, y, z);
                v4[5].pos = DX.VGet(x - w, y, z);
                break;

            case 3:
                v4[0].pos = DX.VGet(x, y + h, z);
                v4[1].pos = DX.VGet(x, y + h, z - w);
                v4[2].pos = DX.VGet(x, y, z - w);
                v4[3].pos = DX.VGet(x, y + h, z);
                v4[4].pos = DX.VGet(x, y, z);
                v4[5].pos = DX.VGet(x, y, z - w);
                break;
            }
            SetupV4(ref v4, uv_x, uv_y, uv_w, uv_h, image_wh_size);

            DX.DrawPolygon3D(out v4[0], 2, image, 0);
        }
예제 #3
0
        void GetDXVectors(out DX.VERTEX3D[] vectors)
        {
            var x = (float)(pos.x);
            var y = (float)(pos.y);
            var z = (float)(pos.z);
            var w = (float)(size.x);
            var h = (float)(size.y);

            vectors = new DX.VERTEX3D[6];
            switch (direction)
            {
            case Direction.Top:
                x -= (float)(size.x / 2.0);
                z -= (float)(size.y / 2.0);
                vectors[0].pos = DX.VGet(x, y, z + h);
                vectors[1].pos = DX.VGet(x + w, y, z + h);
                vectors[2].pos = DX.VGet(x + w, y, z);
                vectors[3].pos = DX.VGet(x, y, z + h);
                vectors[4].pos = DX.VGet(x, y, z);
                vectors[5].pos = DX.VGet(x + w, y, z);
                break;

            case Direction.Wall_NS:
                x -= (float)(size.x / 2.0);
                y -= (float)(size.y / 2.0);
                vectors[0].pos = DX.VGet(x, y + h, z);
                vectors[1].pos = DX.VGet(x + w, y + h, z);
                vectors[2].pos = DX.VGet(x + w, y, z);
                vectors[3].pos = DX.VGet(x, y + h, z);
                vectors[4].pos = DX.VGet(x, y, z);
                vectors[5].pos = DX.VGet(x + w, y, z);
                break;

            case Direction.Wall_EW:
                y -= (float)(size.y / 2.0);
                z -= (float)(size.x / 2.0);
                vectors[0].pos = DX.VGet(x, y + h, z);
                vectors[1].pos = DX.VGet(x, y + h, z + w);
                vectors[2].pos = DX.VGet(x, y, z + w);
                vectors[3].pos = DX.VGet(x, y + h, z);
                vectors[4].pos = DX.VGet(x, y, z);
                vectors[5].pos = DX.VGet(x, y, z + w);
                break;
            }
        }