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


C# TgcSceneLoader.TgcMesh类代码示例

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


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

示例1: BorrarModelo

        public void BorrarModelo(TgcMesh modelo)
        {
            string[] grillas;
            string[] posicion;
            int x;
            int y;
            int z;

            grillas = modelo.UserProperties["gid"].Split('+');

            foreach (string grilla in grillas)
            {
                posicion = grilla.Split('.');
                x = Convert.ToInt32(posicion[0]);
                y = Convert.ToInt32(posicion[1]);
                z = Convert.ToInt32(posicion[2]);

                GrillaRegularNode nodo = grid[x, y, z];

                for (int i = 0; i < nodo.Models.Count; i++)
                {
                    if (nodo.Models[i] == modelo)
                        nodo.Models.RemoveAt(i);
                }
            }
        }
开发者ID:javs,项目名称:Snipers-CEGA,代码行数:26,代码来源:GrillaRegular.cs

示例2: MeshTranslatedScaledPart

 public MeshTranslatedScaledPart(TgcMesh mesh, Vector3 translation, Vector3 scaleFactor)
     : base(mesh)
 {
     Position = _TranslationCurrent = Translation = translation;
     Scale = scaleFactor.MemberwiseMult(_ItemScale = Item.DefaultScale);
     ScaleFactor = scaleFactor;
 }
开发者ID:GastonTS,项目名称:ElElementoPerfecto,代码行数:7,代码来源:MeshTranslatedScaledPart.cs

示例3: fromMesh

        /// <summary>
        /// Crear a partir de un mesh
        /// </summary>
        public static TgcTriangleArray fromMesh(TgcMesh mesh)
        {
            TgcTriangleArray triangleArray = new TgcTriangleArray();

            Vector3[] vertices = mesh.getVertexPositions();
            int triCount = vertices.Length / 3;
            List<TgcTriangle> triangles = new List<TgcTriangle>(triCount);
            for (int i = 0; i < triCount; i++)
            {
                Vector3 v1 = vertices[i * 3];
                Vector3 v2 = vertices[i * 3 + 1];
                Vector3 v3 = vertices[i * 3 + 2];

                TgcTriangle t = new TgcTriangle();
                t.A = v1;
                t.B = v2;
                t.C = v3;
                t.Color = Color.Red;
                t.updateValues();
                triangles.Add(t);
            }

            triangleArray.triangles.AddRange(triangles);
            return triangleArray;
        }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:28,代码来源:TgcTriangleArray.cs

示例4: TgcSkeletalBoneAttach

 /// <summary>
 /// Crear un modelo adjunto a un hueso
 /// </summary>
 /// <param name="model">Modelo a adjuntar</param>
 /// <param name="bone">Hueso al cual adjuntarse</param>
 /// <param name="offset">Offset desde el cual el modelo sigue al hueso</param>
 public TgcSkeletalBoneAttach(TgcMesh mesh, TgcSkeletalBone bone, Matrix offset)
 {
     this.bone = bone;
     this.mesh = mesh;
     this.offset = offset;
     updateValues();
 }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:13,代码来源:TgcSkeletalBoneAttach.cs

示例5: Ship

        public Ship(Vector3 pos, TgcMesh mesh, Canion canion)
        {
            Vector3 size = new Vector3(15, 10, 30);

            this.mesh = mesh;
            this.mesh.Position = pos;

            movZ = pos.Z;
            movY = pos.Y;
            movX = pos.X;
            traslacion = Matrix.Translation(pos);

            movementSpeed = 0f;

            this.mesh.AutoTransformEnable = false;

            vida = VIDA_MAX;

            timer = new TimerFinito(5);

            // Calcular dimensiones
            Vector3 BoundingBoxSize = mesh.BoundingBox.calculateSize();

            LargoBote = Math.Abs(BoundingBoxSize.Z);
            AnchoBote = Math.Abs(BoundingBoxSize.X);
            AltoBote = Math.Abs(BoundingBoxSize.Y);

            this.canion = canion;
            canion.barco = this;

            iniciarBarra();
        }
开发者ID:TGC-CShark,项目名称:pirate-ship,代码行数:32,代码来源:Ship.cs

示例6: MeshTemporalRecursivePart

 public MeshTemporalRecursivePart(TgcMesh mesh, Int32 snapshots = 100)
     : base(mesh)
 {
     _Last = snapshots - 1;
     _Snapshots = new Matrix[snapshots];
     _DeltaAlpha = .666f / snapshots;
 }
开发者ID:GastonTS,项目名称:ElElementoPerfecto,代码行数:7,代码来源:MeshTemporalRecursivePart.cs

示例7: Checkpoint

 public Checkpoint(float x, float z, float y, TgcMesh _modelo)
 {
     _modelo.Position = new Vector3(x, y, z);
     this.modelo = _modelo;
     this.modelo.Scale = new Vector3(5, 5, 5);
     this.obb = TgcObb.computeFromAABB(this.modelo.BoundingBox);
 }
开发者ID:JSorella,项目名称:AlumnoEjemplos,代码行数:7,代码来源:Checkpoint.cs

示例8: init

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

            TgcSceneLoader loader = new TgcSceneLoader();
            TgcScene sceneOriginal = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\Box\\" + "Box-TgcScene.xml");
            TgcMesh meshOriginal = sceneOriginal.Meshes[0];

            TgcMesh meshInstance1 = new TgcMesh(meshOriginal.Name + "-1", meshOriginal,
                new Vector3(50, 0, 0), meshOriginal.Rotation, meshOriginal.Scale);
            meshInstance1.Enabled = true;

            TgcMesh meshInstance2 = new TgcMesh(meshOriginal.Name + "-2", meshOriginal,
                new Vector3(100, 0, 0), meshOriginal.Rotation, meshOriginal.Scale);
            meshInstance2.Enabled = true;

            meshes = new List<TgcMesh>();
            meshes.Add(meshOriginal);
            meshes.Add(meshInstance1);
            meshes.Add(meshInstance2);

            TgcTexture texture = TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\Piso\\Textures\\piso2.jpg");
            meshOriginal.changeDiffuseMaps(new TgcTexture[] { texture });

            GuiController.Instance.FpsCamera.Enable = true;
        }
开发者ID:JesusHerrera,项目名称:tgc-viewer,代码行数:26,代码来源:EjemploMeshInstance.cs

示例9: init

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

            string sphere = GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\Sphere\\Sphere-TgcScene.xml";

            TgcSceneLoader loader = new TgcSceneLoader();

            //Cargar modelos para el sol, la tierra y la luna. Son esfereas a las cuales le cambiamos la textura
            sun = loader.loadSceneFromFile(sphere).Meshes[0];
            sun.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\SunTexture.jpg") });
            
            earth = loader.loadSceneFromFile(sphere).Meshes[0];
            earth.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\EarthTexture.jpg") });
            
            moon = loader.loadSceneFromFile(sphere).Meshes[0];
            moon.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\MoonTexture.jpg") });
            

            //Deshabilitamos el manejo automático de Transformaciones de TgcMesh, para poder manipularlas en forma customizada
            sun.AutoTransformEnable = false;
            earth.AutoTransformEnable = false;
            moon.AutoTransformEnable = false;


            //Color de fondo
            GuiController.Instance.BackgroundColor = Color.Black;


            //Camara en primera persona
            GuiController.Instance.FpsCamera.Enable = true;
            GuiController.Instance.FpsCamera.setCamera(new Vector3(705.2938f, 305.347f, -888.1567f), new Vector3(183.6915f, 19.6596f, -84.2204f));
        }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:33,代码来源:SistemaSolar.cs

示例10: init

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

            //Cargar mesh
            TgcSceneLoader loader = new TgcSceneLoader();
            mesh = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\LogoTGC\\LogoTGC-TgcScene.xml").Meshes[0];

            //Cargar Shader de PhongShading
            mesh.Effect = GuiController.Instance.Shaders.TgcMeshPhongShader;
            mesh.Technique = GuiController.Instance.Shaders.getTgcMeshTechnique(mesh.RenderType);

            //Texto help
            textHelp = new TgcText2d();
            textHelp.Position = new Point(15, 260);
            textHelp.Size = new Size(500, 100);
            textHelp.changeFont(new System.Drawing.Font("TimesNewRoman", 16, FontStyle.Regular));
            textHelp.Color = Color.Yellow;
            textHelp.Align = TgcText2d.TextAlign.LEFT;
            textHelp.Text = "¿Por dónde empezar? Presionar \"H\"";

            //Help form
            string helpRtf = File.ReadAllText(GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\LogoTGC\\help.rtf");
            helpForm = new EjemploDefaultHelpForm(helpRtf);

            //Camara
            GuiController.Instance.RotCamera.Enable = true;
            GuiController.Instance.RotCamera.CameraCenter = new Vector3(0, 0, 0);
            GuiController.Instance.RotCamera.CameraDistance = 150;

            GuiController.Instance.BackgroundColor = Color.Black;
        }
开发者ID:JesusHerrera,项目名称:tgc-viewer,代码行数:32,代码来源:EjemploDefault.cs

示例11: instanceOf

        protected TgcMesh instanceOf(TgcMesh m)
        {
            TgcMesh i = m.createMeshInstance(m.Name+m.MeshInstances.Count.ToString());
            i.AlphaBlendEnable = m.AlphaBlendEnable;
            return i;

        }
开发者ID:aniPerezG,项目名称:barbalpha,代码行数:7,代码来源:InstanceManager.cs

示例12: MeshTransformedPart

 public MeshTransformedPart(TgcMesh mesh)
     : base(mesh)
 {
     Scale = Item.DefaultScale;
     Rotation = Item.DefaultRotation;
     Position = Item.DefaultPosition;
     RotationMatrix = Item.DefaultRotationMatrix;
 }
开发者ID:GastonTS,项目名称:ElElementoPerfecto,代码行数:8,代码来源:MeshTransformedPart.cs

示例13: MeshPart

 public MeshPart(TgcMesh mesh)
 {
     Mesh = mesh;
     mesh.AlphaBlendEnable = true;
     mesh.AutoTransformEnable = false;
     mesh.AutoUpdateBoundingBox = false;
     _Technique = mesh.Technique;
 }
开发者ID:GastonTS,项目名称:ElElementoPerfecto,代码行数:8,代码来源:MeshPart.cs

示例14: EnemyShip

 public EnemyShip(Ship player, Vector3 pos, TgcMesh mesh, Canion canion)
     : base(pos, mesh, canion)
 {
     nombre = "ENEMIGO";
     this.player = player;
     anguloRotacion = FastMath.PI / 2;
     iniciarBarra();
 }
开发者ID:TGC-CShark,项目名称:pirate-ship,代码行数:8,代码来源:EnemyShip.cs

示例15: Chispa

 public Chispa()
 {
     TgcSceneLoader loader = new TgcSceneLoader();
     mesh = loader.loadSceneFromFile(sphere).Meshes[0];
     mesh.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, Shared.mediaPath + "\\otros\\giallo.png") });
     mesh.Scale = new Vector3(0.08f, 0.08f, 0.08f);
 }
开发者ID:JSorella,项目名称:AlumnoEjemplos,代码行数:7,代码来源:Chispa.cs


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