当前位置: 首页>>代码示例>>C#>>正文


C# TgcMesh.move方法代码示例

本文整理汇总了C#中TgcViewer.Utils.TgcSceneLoader.TgcMesh.move方法的典型用法代码示例。如果您正苦于以下问题:C# TgcMesh.move方法的具体用法?C# TgcMesh.move怎么用?C# TgcMesh.move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TgcViewer.Utils.TgcSceneLoader.TgcMesh的用法示例。


在下文中一共展示了TgcMesh.move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: init

        public override void init()
        {
            Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice;

            //Cargar escena
            TgcSceneLoader loader = new TgcSceneLoader();
            scene = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Scenes\\Ciudad\\Ciudad-TgcScene.xml");

            //Cargar mesh principal
            mainMesh = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Vehiculos\\Hummer\\Hummer-TgcScene.xml").Meshes[0];

            //Movemos el mesh un poco para arriba. Porque sino choca con el piso todo el tiempo y no se puede mover.
            mainMesh.move(0, 5, 0);

            //Camera en 3ra persona
            GuiController.Instance.ThirdPersonCamera.Enable = true;
            GuiController.Instance.ThirdPersonCamera.setCamera(mainMesh.Position, 200, 300);
        }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:18,代码来源:Tutorial8.cs

示例2: init


//.........这里部分代码省略.........
            inicializarPiedras();

            totales = new List<TgcMesh>();
            totales.AddRange(arboles);
            totales.AddRange(pasto);
            totales.AddRange(piedras);

            qt = new Quadtree();
            qt.create(totales, bbSkyBox);
            qt.createDebugQuadtreeMeshes();

            //Crear texto vida, básico
            vida = new TgcText2d();
            vida.Text = "100";
            vida.Color = Color.White;
            vida.Size = new Size(300, 100);
            vida.changeFont(new System.Drawing.Font("BankGothic Md BT", 25, FontStyle.Bold));
            vida.Position = new Point(-60, 0);

            barraVida = new TgcSprite();
            barraVida.Texture = TgcTexture.createTexture(alumnoMediaFolder + "\\barra_vida.png");
            barraVida.Position = new Vector2((float)vida.Position.X + 175f, (float)vida.Position.Y);
            barraVida.Scaling = new Vector2(0.3f, 0.3f);

            textoPuntaje = new TgcText2d();
            textoPuntaje.Text = "Puntos: 0";
            textoPuntaje.Color = Color.White;
            textoPuntaje.Size = new Size(300, 100);
            textoPuntaje.changeFont(new System.Drawing.Font("BankGothic Md BT", 25, FontStyle.Bold));
            textoPuntaje.Position = new Point(screenSize.Width - 300, 0);

            TgcSceneLoader loaderLogo = new TgcSceneLoader();
            logoTgc = loaderLogo.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\LogoTGC\\LogoTGC-TgcScene.xml").Meshes[0];
            logoTgc.move(new Vector3(0f, 1900f, 0f));
            logoTgc.Scale = new Vector3(14f, 14f, 14f);

            //Cargar Shader de PhongShading
            logoTgc.Effect = GuiController.Instance.Shaders.TgcMeshPhongShader;
            logoTgc.Technique = GuiController.Instance.Shaders.getTgcMeshTechnique(logoTgc.RenderType);
            //Cargar variables shader
            logoTgc.Effect.SetValue("ambientColor", ColorValue.FromColor(Color.Gray));
            logoTgc.Effect.SetValue("diffuseColor", ColorValue.FromColor(Color.LightBlue));
            logoTgc.Effect.SetValue("specularColor", ColorValue.FromColor(Color.White));
            logoTgc.Effect.SetValue("specularExp", 20f);
            logoTgc.Effect.SetValue("lightPosition", lightPos);
            reproducirSorpresa = false;

            //////VARIABLES DE FRUSTUM

            aspectRatio = (float)GuiController.Instance.Panel3d.Width / GuiController.Instance.Panel3d.Height;

            ruedita = 0f;

            //Inicializo angulo de FOV
            anguloFov = FastMath.ToRad(45.0f);

            GuiController.Instance.D3dDevice.Transform.Projection = Matrix.PerspectiveFovLH(anguloFov, aspectRatio, 1f, 50000f);

            ///////////////USER VARS//////////////////
            /*
            //Crear una UserVar
            GuiController.Instance.UserVars.addVar("variablePrueba");

            //Cargar valor en UserVar
            GuiController.Instance.UserVars.setValue("variablePrueba", 5451);
            */
开发者ID:julisalis,项目名称:2015-tgc-fps,代码行数:67,代码来源:EjemploAlumno.cs

示例3: Game

        public Game()
        {
            Fuentes.cargarFuentes();

            //sprites
            if (!inicializo)
            {
                mapita = new TgcSprite();
                mapita.Texture = TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "\\sprites\\preview.png");
                motoSprite = new TgcSprite();
                motoSprite.Texture = TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "\\sprites\\dirtbike.png");
                timer = new TgcSprite();
                timer.Texture = TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "\\sprites\\gate.png");

                //Ubicarlo centrado en la pantalla
                screenSize = GuiController.Instance.Panel3d.Size;
                textureSize = mapita.Texture.Size;
                motoTextureSize = motoSprite.Texture.Size;
                mapita.Scaling = (new Vector2(0.7f, 0.7f));
                motoSprite.Scaling = (new Vector2(0.5f, 0.5f));

                mapita.Position = new Vector2(FastMath.Max(screenSize.Width / 2 - textureSize.Width * 0.7f / 2, 0), 16);

                motoSprite.Position = new Vector2(FastMath.Max(screenSize.Width / 2 - motoTextureSize.Width * 0.5f / 2 - textureSize.Width * 0.7f / 2, 0), 8);

                timer.Position = new Vector2(screenSize.Width - 250, screenSize.Height - 125);

                timer.Scaling = new Vector2(0.9f, 0.8f);
                posMotoInicial = motoSprite.Position;
                inicializo = true;
            }
            d3dDevice = GuiController.Instance.D3dDevice;

            d3dDevice.Transform.Projection =
                Matrix.PerspectiveFovLH(Geometry.DegreeToRadian(45.0f),
                TgcD3dDevice.aspectRatio, 1f, 5000000f);

            string texturesPath = GuiController.Instance.AlumnoEjemplosMediaDir + "skybox\\";
            TgcSceneLoader loader = new TgcSceneLoader();
            collisionManager = new ElipsoidCollisionManager();
            collisionManager.GravityEnabled = false;
            tiempoAcelerando = 0f;
            tiempoDescelerando = 0f;
            velIni = 0f;
            tocandoPiso = false;
            saltando = true;
            ultimoMov = new Vector3(0, 0, 0);

            //skybox
            inicializarSkybox(texturesPath);

            //checkpoints
            int posCP = -150;
            foreach (TgcBoundingBox bb in checkpoints)
            {
                bb.setExtremes(new Vector3(-200, -100, posCP), new Vector3(200, 1000, posCP - 10));
                posCP -= 1300;
            }

            //carga la ciudad
            scene = loader.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "pistaDesierto\\pistaDesierto2-TgcScene.xml");

            //cargo la moto
            motorcycle = loader.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "moto\\Moto2-TgcScene.xml").Meshes[0];
            motorcycle.move(-40, 100, -150);

            //cargo la piramide
            piramid = loader.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "piramide\\piramide-TgcScene.xml").Meshes[0];
            piramid.Scale = new Vector3(5, 5, 5);
            piramid.move(-265, -45, -13750);

            //cargo texto ganaste

            textGanaste = new TgcText2d();
            textGanaste2 = new TgcText2d();

            //Cargar Textos
            textGanaste.Text = "FELICIDADES, HAS GANADO";
            textGanaste2.Text = "APRETE Q PARA VOLVER AL MENU";
            textGanaste.Position = new Point(0, 50);
            textGanaste2.Position = new Point(0, 100);
            textGanaste.changeFont(new System.Drawing.Font("TimesNewRoman", 23, FontStyle.Bold | FontStyle.Bold));
            textGanaste2.changeFont(new System.Drawing.Font("TimesNewRoman", 23, FontStyle.Bold | FontStyle.Bold));

            textGanaste.Color = Color.White;
            textGanaste2.Color = Color.White;

            // Creo texto contador de tiempo
            textoContadorTiempo = new TgcText2d();
            textoContadorTiempo.Color = Color.Black;
            textoContadorTiempo.Align = TgcText2d.TextAlign.RIGHT;
            textoContadorTiempo.Position = new Point(630, 400); //(680, 400)
            textoContadorTiempo.Size = new Size(300, 100);
            textoContadorTiempo.changeFont(new System.Drawing.Font(Fuentes.fuente.Families[0], 25, FontStyle.Regular));

            // Creo texto mejor tiempo
            textoMejorTiempo = new TgcText2d();
            textoMejorTiempo.Color = Color.Black;
            textoMejorTiempo.Align = TgcText2d.TextAlign.RIGHT;
            textoMejorTiempo.Position = new Point(630, 430);  //(680, 430)
//.........这里部分代码省略.........
开发者ID:azmodan93,项目名称:TGC-Legion,代码行数:101,代码来源:Game.cs


注:本文中的TgcViewer.Utils.TgcSceneLoader.TgcMesh.move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。