本文整理汇总了C#中TgcViewer.Utils.TgcSceneLoader.TgcMesh类的典型用法代码示例。如果您正苦于以下问题:C# TgcMesh类的具体用法?C# TgcMesh怎么用?C# TgcMesh使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TgcMesh类属于TgcViewer.Utils.TgcSceneLoader命名空间,在下文中一共展示了TgcMesh类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: BarcoBot
public BarcoBot(int vida, int danio, float velocidad,float aceleracion, float rotacion, TgcMesh mesh, double pot, Barco barcoEnemigo,TgcSceneLoader bm,TgcMesh bala)
: base(vida, danio, velocidad, rotacion, mesh,pot,bm,bala)
{
BarcoEnemigo = barcoEnemigo;
LastPos = Mesh.Position;
BarcosEnemigos.Add(barcoEnemigo);
daniado = false;
}
开发者ID:FunnyBoxification,项目名称:TGC,代码行数:8,代码来源:BarcoBot.cs
示例16: getMesh
public static TgcMesh getMesh()
{
if (originalMesh == null)
{
TgcScene sceneBarril = EscenarioManager.Instance.loader.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "RenderMan\\modelos\\BarrilPolvora\\BarrilPolvora-TgcScene.xml");
TgcMesh barrilMesh = sceneBarril.Meshes[0];
originalMesh = barrilMesh;
}
return originalMesh.createMeshInstance("barril");
}
开发者ID:nicolasazrak,项目名称:RenderMan,代码行数:10,代码来源:Barril.cs
示例17: EditablePoly
/// <summary>
/// Construir un EditablePoly a partir de un mesh
/// </summary>
public EditablePoly(MeshCreatorControl control, TgcMesh origMesh)
{
this.control = control;
this.currentPrimitive = PrimitiveType.None;
this.rectMesh = new SelectionRectangleMesh();
this.selectionList = new List<EditPolyPrimitive>();
this.primitiveRenderer = new PrimitiveRenderer(this);
this.translateGizmo = new EditablePolyTranslateGizmo(this);
this.deletedTriangles = new List<int>();
loadMesh(origMesh);
}
开发者ID:JesusHerrera,项目名称:tgc-viewer,代码行数:14,代码来源:EditablePoly.cs
示例18: TgcRTLMesh
public TgcRTLMesh(TgcMesh parent, Color ambientColor, Color diffuseColor, Color specularColor, float shininess)
: base(parent.Name, parent, parent.Position, parent.Rotation, parent.Scale)
{
this.Enabled = true;
material.Ambient = ambientColor;
material.Diffuse = diffuseColor;
material.Specular = specularColor;
material.SpecularSharpness = shininess;
//TODO: Autoinicializar el efecto
}
开发者ID:pablitar,项目名称:tgc-mirrorball,代码行数:12,代码来源:TgcRTLMesh.cs
示例19: mover
public void mover(LightData luz, TgcMesh meshLuz, float elapsedTime)
{
Matrix directionRotationMatrix = Matrix.RotationX(FastMath.QUARTER_PI * elapsedTime);
luz.direccion.TransformCoordinate(directionRotationMatrix);
Matrix trans = Matrix.Translation(meshLuz.Position);
Matrix trasp = Matrix.Invert(trans);
meshLuz.Transform = Matrix.Multiply(trasp, directionRotationMatrix) * trans * meshLuz.Transform;
meshLuz.render();
}
开发者ID:pablitar,项目名称:tgc-mirrorball,代码行数:12,代码来源:RotarEjeX.cs
示例20: 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;未经允许,请勿转载。 |
请发表评论