Esempio n. 1
0
        public CubeImport(ref Device srcDev, ref DeviceContext srcDevCon)
        {
            xRot     = yRot = zRot = 0.0f;
            viewProj = Matrix.Identity;

            dev    = srcDev;
            devCon = srcDevCon;

            x1 = new X_Mesh_Loader();
            x1.readSourceFile("cube.x");
            //x1.readSourceFile("terrain6s.x");
            x1.readMeshTokens();
            x1.readMeshNormalTokens();
            x1.readMeshTextureUVTokens();

            var rot = Matrix.RotationX(xRot) * Matrix.RotationY(yRot) * Matrix.RotationZ(zRot);
            var wvp = rot; // * viewProj;

            //wvp *= Matrix.Translation(10.0f, 50.0f, 10.0f);
            wvp.Transpose();

            cBufferData       = new cBufferStruct();
            cBufferData.wvp   = wvp;
            cBufferData.world = viewProj;
            //cBufferData.lightDir = new Vector4(2.667f, 2.667f, -5.567f, 1.0f);
            cBufferData.lightDir  = new Vector4(-10.50f, 70.00f, -10.50f, 1.0f);
            cBufferData.lightCol  = new Vector4(0.3f, 0.4f, 0.45f, 1.0f);
            cBufferData.lightCol2 = new Vector4(0.3f, 0.4f, 0.45f, 1.0f);
        }
Esempio n. 2
0
        public Skydome(ref Device srcDev, ref DeviceContext srcDevCon)
        {
            viewProj = Matrix.Identity;

            dev    = srcDev;
            devCon = srcDevCon;

            x1 = new X_Mesh_Loader();
            x1.readSourceFile("skydome.x");
            x1.readMeshTokens();
            x1.readMeshNormalTokens();
            x1.readMeshTextureUVTokens();
        }