Пример #1
0
 public River()
 {
     water = new TextureElement("water1.jpg");
     water.Scale(1.0f);
     water.RotateShape(Vector3.UnitX, 45f);
     water.Move(0f, -0.8f, 0f);
 }
        protected override void init()
        {
            g_fzNear = 1.0f;
            g_fzFar = 1000.0f;
            InitializePrograms();

            try
            {
                string XmlFilesDirectory = GlsTutorialsClass.ProjectDirectory + @"/XmlFilesForMeshes";
                Stream corridor = File.OpenRead(XmlFilesDirectory + @"/corridor.xml");
                g_pCorridor = new Mesh(corridor);
                Stream plane = File.OpenRead(XmlFilesDirectory + @"/bigplane.xml");
                g_pPlane = new Mesh(plane);
            }
            catch(Exception ex)
            {
                MessageBox.Show("Error creating meshes " + ex.ToString());
            }

            SetupDepthAndCull();

            LoadCheckerTexture();
            LoadMipmapTexture();
            CreateSamplers();

            textureSphereProgram = ts.GetProgram();
            ts.SetProgram(manyImageProgram);

            te = new TextureElement("wood4_rotate.png");
            textureElementProgram = te.GetProgram();
            te.SetProgram(manyImageProgram);
            textureElementTexture = te.GetTexture();
            te.Scale(new Vector3(0.4f, 0.4f, 10f));
            te.RotateShape(Vector3.UnitX, 45f);
        }