public List <TgcMesh> CreateColumn(TgcPlane columnPlaneX, TgcPlane columnPlaneZ, TGCVector3 offset) { List <TgcMesh> columna = new List <TgcMesh>(); var baseWall = columnPlaneX; var wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(Position.X + 5 + offset.X, Position.Y, Position.Z + offset.Z); wallMesh.UpdateMeshTransform(); columna.Add(wallMesh); wallMesh = baseWall.toMesh("Column1V2"); wallMesh.Position = new TGCVector3(Position.X + offset.X, Position.Y, Position.Z + offset.Z); wallMesh.UpdateMeshTransform(); columna.Add(wallMesh); baseWall = columnPlaneZ; wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(Position.X + offset.X, Position.Y, Position.Z + 5 + offset.Z); wallMesh.UpdateMeshTransform(); columna.Add(wallMesh); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(Position.X + offset.X, Position.Y, Position.Z + offset.Z); wallMesh.UpdateMeshTransform(); columna.Add(wallMesh); return(columna); }
public override TgcMesh createMeshToExport() { var m = mesh.toMesh(Name); m.UserProperties = UserProperties; m.Layer = Layer; m.AutoTransformEnable = true; return(m); }
public Track(TGCVector3 centro, string pathTextura, int repeticiones) { //var d3dDevice = D3DDevice.Instance.Device; //var shader = Effect.FromFile(d3dDevice, MediaDir + "MotionBlur.fx",null, null, ShaderFlags.PreferFlowControl, null, out compilationErrors); repeat = repeticiones; center = centro; var size_lados = new TGCVector3(0, 320, 640); var size_suelo = new TGCVector3(160, 0, 640); textura = TgcTexture.createTexture(pathTextura); walls_l = new List <TgcMesh>(); walls_r = new List <TgcMesh>(); floors = new List <TgcMesh>(); var plane = new TgcPlane(center, center, TgcPlane.Orientations.YZplane, textura); for (int i = 0; i < repeticiones; i++) { var walll = new TgcPlane(center + new TGCVector3(-80, -160, -320 - (i * 640)), size_lados, TgcPlane.Orientations.YZplane, textura); walls_l.Add(walll.toMesh("wall_l_" + i)); var wallr = new TgcPlane(center + new TGCVector3(80, -160, -320 - (i * 640)), size_lados, TgcPlane.Orientations.YZplane, textura); walls_r.Add(wallr.toMesh("wall_r_" + i)); var floor = new TgcPlane(center + new TGCVector3(-80, -160, -320 - (i * 640)), size_suelo, TgcPlane.Orientations.XZplane, textura); floors.Add(floor.toMesh("floor_" + i)); } }
private void InitializeMeshes() { TgcTexture tiles, lava, stones, water; tiles = TgcTexture.createTexture(MediaDir + "Textures/tiles.jpg"); lava = TgcTexture.createTexture(MediaDir + "Textures/lava.jpg"); stones = TgcTexture.createTexture(MediaDir + "Textures/stones.bmp"); water = TgcTexture.createTexture(MediaDir + "Textures/water.bmp"); TGCSphere baseSphere = new TGCSphere(1f, Color.White, TGCVector3.Empty); baseSphere.setTexture(lava); baseSphere.updateValues(); sphereOne = baseSphere.toMesh("sphereOne"); meshes.Add(sphereOne); baseSphere.setTexture(stones); sphereTwo = baseSphere.toMesh("sphereTwo"); meshes.Add(sphereTwo); baseSphere.setTexture(water); sphereThree = baseSphere.toMesh("sphereThree"); meshes.Add(sphereThree); TgcSceneLoader loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "Robot2-TgcScene.xml"); robot = scene.Meshes[0]; robot.Transform = TGCMatrix.Scaling(0.1f, 0.1f, 0.1f) * TGCMatrix.RotationY(FastMath.PI) * TGCMatrix.Translation(TGCVector3.Up * 40f); meshes.Add(robot); TgcPlane tgcPlane = new TgcPlane(TGCVector3.Empty, TGCVector3.One * 100f, TgcPlane.Orientations.XZplane, tiles, 10f, 10f); plane = tgcPlane.toMesh("plane"); meshes.Add(plane); }
private void LoadFatherNote() { var noteTexture = TgcTexture.createTexture(D3DDevice.Instance.Device, MediaDir + "\\Level1\\Textures\\" + "noteTexture.png"); var notePosition = new TGCVector3(9820, 30, 880); var noteSize = new TGCVector3(20, 40, 20); TgcPlane note = new TgcPlane(notePosition, noteSize, TgcPlane.Orientations.XYplane, noteTexture); collectModel.CollisionMeshes.Add(new ItemModel { Mesh = note.toMesh("fatherNote"), IsCollectable = true, CollectablePosition = notePosition }); }
private void InitializeFloor() { var floor = TgcTexture.createTexture(MediaDir + "Texturas\\tierra.jpg"); var planeSize = new TGCVector3(200f, 0f, 200f); var planeMesh = new TgcPlane(TGCVector3.Scale(planeSize, -0.5f), planeSize, TgcPlane.Orientations.XZplane, floor, 5f, 5f); planeMesh.updateValues(); plane = planeMesh.toMesh("floor"); plane.Transform = TGCMatrix.RotationX(FastMath.PI) * plane.Transform; plane.Effect = effect; plane.Technique = "Blinn"; }
public Tower(Vector3 newPosition, string wallTexture, string columnTexture) { this.position = newPosition; //Armamos muros a partir de un Plano y lo convertimos a Mesh var baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(40, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(wallTexture), 2, 4); var wallMesh = baseWall.toMesh("WallHA"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); wallMesh = baseWall.toMesh("WallHA"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 40), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(wallTexture), 2, 4); wallMesh = baseWall.toMesh("WallHA"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); wallMesh = baseWall.toMesh("WallHA"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); //Columnas //1 baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); //2 baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 50, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); //3 baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 50, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y, position.Z + 50); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); //4 baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 80, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 45); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 80, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 4); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 50); wallMesh.UpdateMeshTransform(); towerWalls.Add(wallMesh); }
public Pit(TGCVector3 newPosition, TgcPlane grassPlane, TgcPlane wallPlaneX, TgcPlane wallPlaneZ, TgcPlane wallPlaneVertX, TgcPlane columnPlaneX, TgcPlane columnPlaneZ, TgcPlane topPlane) { this.Position = newPosition; //Se define el terrno de la parcela var grassMesh = grassPlane.toMesh("floor"); grassMesh.Position = new TGCVector3(this.Position.X, this.Position.Y - 20, this.Position.Z); grassMesh.Transform = TGCMatrix.Translation(grassMesh.Position); meshes.Add(grassMesh); //Armamos muros a partir de un Plano y lo convertimos a Mesh var baseTriangleWallH = wallPlaneZ; var wallMesh = baseTriangleWallH.toMesh("WallHA"); wallMesh.RotateX(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(newPosition.X, newPosition.Y - 20, newPosition.Z + 5); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("WallHB"); wallMesh.RotateX(FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(newPosition.X, newPosition.Y - 20, newPosition.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); var baseWall = wallPlaneX; wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(newPosition.X + 5, newPosition.Y - 20, newPosition.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.RotateZ(-FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(newPosition.X + 45, newPosition.Y - 20, newPosition.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = wallPlaneVertX; wallMesh = baseWall.toMesh("WallVA"); wallMesh.Position = new TGCVector3(newPosition.X, newPosition.Y, newPosition.Z); wallMesh.Transform = TGCMatrix.Translation(wallMesh.Position); meshes.Add(wallMesh); wallMesh = baseWall.toMesh("WallVA"); wallMesh.Position = new TGCVector3(newPosition.X + 50, newPosition.Y, newPosition.Z); wallMesh.Transform = TGCMatrix.Translation(wallMesh.Position); meshes.Add(wallMesh); //Columnas var column = new Column { Position = new TGCVector3(this.Position.X, this.Position.Y - 20, this.Position.Z) }; meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, TGCVector3.Empty)); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(0, 0, 45))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 0))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 45))); //Tapas de columnas baseWall = topPlane; wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(newPosition.X, newPosition.Y + 20, newPosition.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(newPosition.X + 45, newPosition.Y + 20, newPosition.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(newPosition.X + 45, newPosition.Y + 20, newPosition.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(newPosition.X, newPosition.Y + 20, newPosition.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); }
//TODO: manejar todos los mesh de cada parcela en una una coleccion public SuperiorLeft(TGCVector3 Position, TgcPlane grassPlane, TgcPlane wallPlaneX, TgcPlane wallPlaneZ, TgcPlane columnPlaneX, TgcPlane columnPlaneZ, TgcPlane topPlane, TgcMesh plantModel) { this.Position = Position; //Se define el terrno de la parcela var grassMesh = grassPlane.toMesh("floor"); grassMesh.Position = this.Position; grassMesh.Transform = TGCMatrix.Translation(grassMesh.Position); meshes.Add(grassMesh); //Variable temporal que contiene el modelo var basePlant = plantModel; basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 45); basePlant.Scale = new TGCVector3(0.5f, 0.5f, 0.5f); var random = new Random(); var ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.Enabled = true; basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaizquierda2"); basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 25); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaizquierda4"); basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 5); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba1"); basePlant.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba3"); basePlant.Position = new TGCVector3(Position.X + 25, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba5"); basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); var baseWall = wallPlaneX; var wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = wallPlaneZ; wallMesh = baseWall.toMesh("WallB"); wallMesh.RotateX(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); //Columnas var column = new Column { Position = this.Position }; meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, TGCVector3.Empty)); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(0, 0, 45))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 0))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 45))); //Tapas de columnas baseWall = topPlane; wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); }
public void Init() { var loader = new TgcSceneLoader(); Items = new List <Recolectable>(); Piezas = new List <Pieza>(); Objetos = new List <Colisionable>(); MeshARenderizar = new List <TgcMesh>(); meshFogatas = new List <TgcMesh>(); IluminacionEscenario = new List <Fogata>(); //Instancia de skybox skyBox = new TgcSkyBox(); skyBox.Center = TGCVector3.Empty; skyBox.Size = new TGCVector3(9000, 9000, 9000); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Up, MediaDir + "cielo.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Down, MediaDir + "cielo.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Left, MediaDir + "cielo.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Right, MediaDir + "cielo.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Front, MediaDir + "cielo.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Back, MediaDir + "cielo.jpg"); skyBox.SkyEpsilon = 25f; skyBox.Init(); //Instancio la vegetacion var scene = loader.loadSceneFromFile(MediaDir + @"Pino-TgcScene.xml"); var PinoOriginal = scene.Meshes[0]; List <TGCVector3> posicionesArboles = new List <TGCVector3>(); posicionesArboles.Add(new TGCVector3(1, 1, 1)); posicionesArboles.Add(new TGCVector3(-3442, 1, -2736)); posicionesArboles.Add(new TGCVector3(-3689, 1, -3039)); posicionesArboles.Add(new TGCVector3(-3799, 1, -2719)); posicionesArboles.Add(new TGCVector3(-3417, 1, -2480)); posicionesArboles.Add(new TGCVector3(-2917, 1, -2433)); posicionesArboles.Add(new TGCVector3(-3668, 1, -2025)); posicionesArboles.Add(new TGCVector3(-3362, 1, -2009)); posicionesArboles.Add(new TGCVector3(-3451, 1, -3786)); posicionesArboles.Add(new TGCVector3(-4037, 1, -2329)); posicionesArboles.Add(new TGCVector3(-2885, 1, -1826)); posicionesArboles.Add(new TGCVector3(-4123, 1, -1581)); posicionesArboles.Add(new TGCVector3(-3289, 1, -909)); posicionesArboles.Add(new TGCVector3(-4261, 1, -435)); posicionesArboles.Add(new TGCVector3(-2883, 1, -655)); posicionesArboles.Add(new TGCVector3(-3352, 1, -1761)); posicionesArboles.Add(new TGCVector3(-3244, 1, -2394)); posicionesArboles.Add(new TGCVector3(-3978, 1, -2572)); posicionesArboles.Add(new TGCVector3(-3517, 1, -1982)); posicionesArboles.Add(new TGCVector3(-3118, 1, -1524)); posicionesArboles.Add(new TGCVector3(-3349, 1, -980)); posicionesArboles.Add(new TGCVector3(-4110, 1, -407)); posicionesArboles.Add(new TGCVector3(-3304, 1, -1774)); posicionesArboles.Add(new TGCVector3(-3139, 1, -1269)); posicionesArboles.Add(new TGCVector3(-2140, 1, -562)); posicionesArboles.Add(new TGCVector3(-4094, 1, -145)); posicionesArboles.Add(new TGCVector3(-3103, 1, -1337)); posicionesArboles.Add(new TGCVector3(-2896, 1, -1087)); posicionesArboles.Add(new TGCVector3(-2529, 1, 10)); posicionesArboles.Add(new TGCVector3(-3917, 1, 772)); posicionesArboles.Add(new TGCVector3(746, 1, 157)); posicionesArboles.Add(new TGCVector3(951, 1, 637)); posicionesArboles.Add(new TGCVector3(1361, 1, 404)); posicionesArboles.Add(new TGCVector3(1361, 1, 440)); posicionesArboles.Add(new TGCVector3(-3877, 1, -678)); posicionesArboles.Add(new TGCVector3(-3997, 1, -1079)); posicionesArboles.Add(new TGCVector3(-3996, 1, -1617)); posicionesArboles.Add(new TGCVector3(-3701, 1, -1505)); posicionesArboles.Add(new TGCVector3(-3761, 1, -1069)); posicionesArboles.Add(new TGCVector3(-3968, 1, -1952)); posicionesArboles.Add(new TGCVector3(-3550, 1, -1562)); posicionesArboles.Add(new TGCVector3(-3557, 1, -1192)); posicionesArboles.Add(new TGCVector3(-3938, 1, -1048)); posicionesArboles.Add(new TGCVector3(-3148, 1, -268)); posicionesArboles.Add(new TGCVector3(-4120, 1, 433)); posicionesArboles.Add(new TGCVector3(-3136, 1, -135)); posicionesArboles.Add(new TGCVector3(-2793, 1, -476)); var indiceArbolDirectorio = (new Random()).Next(posicionesArboles.Count, posicionesArboles.Count + 100); arbolesMesh = new List <TgcMesh>(); Colisionable Arbol; for (var i = 0; i < posicionesArboles.Count; i++) { var Instance = PinoOriginal.createMeshInstance("Pino" + i); Arbol = new SinEfecto(Instance); Arbol.mesh.Move(0, 0, 0); Arbol.mesh.Scale = new TGCVector3(0.05f * i, 0.05f * i, 0.05f * i); Arbol.mesh.Move(posicionesArboles[i]); Arbol.mesh.Transform = TGCMatrix.Translation(posicionesArboles[i]); Objetos.Add(Arbol); MeshARenderizar.Add(Arbol.mesh); arbolesMesh.Add(Arbol.mesh); } for (var i = posicionesArboles.Count; i < posicionesArboles.Count + 100; i++) { var Instance = PinoOriginal.createMeshInstance("Pino" + i); if (i == indiceArbolDirectorio) { Arbol = new ArbolDirectorio(MediaDir); } else { Arbol = new SinEfecto(Instance); } Arbol.mesh.Move(0, 0, 0); Arbol.mesh.Scale = new TGCVector3(0.01f * i, 0.01f * i, 0.01f * i); Arbol.mesh.Move(new TGCVector3(((float)Math.Pow(i, Math.PI) % 2066) + 98, 1, ((float)Math.Pow(i, Math.E) % 3136) - 1339)); Arbol.mesh.Transform = TGCMatrix.Translation(new TGCVector3(((float)Math.Pow(i, Math.PI) % 2066) + 98, 1, ((float)Math.Pow(i, Math.E) % 3136) - 1339)); Objetos.Add(Arbol); MeshARenderizar.Add(Arbol.mesh); arbolesMesh.Add(Arbol.mesh); } foreach (var mesh in arbolesMesh) { mesh.AlphaBlendEnable = true; } //Instancio el terreno (Heigthmap) terreno = new TgcSimpleTerrain(); var pathTextura = MediaDir + "Textures\\mapa1.jpg"; var pathHeighmap = MediaDir + "mapa1.jpg"; currentScaleXZ = 100f; currentScaleY = 3f; terreno.loadHeightmap(pathHeighmap, currentScaleXZ, currentScaleY, new TGCVector3(0, -30, 0)); terreno.loadTexture(pathTextura); //Instancio el piso var pisoTexture = TgcTexture.createTexture(D3DDevice.Instance.Device, MediaDir + "Textures\\water2.jpg"); Plano = new TgcPlane(new TGCVector3(-tamanioMapa / 2, 0, -tamanioMapa / 2), new TGCVector3(tamanioMapa, 0, tamanioMapa), TgcPlane.Orientations.XZplane, pisoTexture, 50f, 50f); MeshPlano = Plano.toMesh("MeshPlano"); Objetos.Add(new SinEfecto(MeshPlano)); MeshARenderizar.Add(MeshPlano); piezaAsociadaLago = new Pieza(2, "Pieza 2", MediaDir + "\\2D\\windows\\windows_2.png", null); pistaAsociadaLago = new Pista(null, MediaDir + "\\2D\\pista_hacha.png", null); //Instancio la Cabania var sceneCabania = loader.loadSceneFromFile(MediaDir + @"cabania-TgcScene.xml"); foreach (var Mesh in sceneCabania.Meshes) { Mesh.Move(-500, 20, 500); Mesh.Scale = new TGCVector3(4.5f, 4.5f, 4.5f); Mesh.Transform = TGCMatrix.Scaling(Mesh.Scale); Objetos.Add(new SinEfecto(Mesh)); MeshARenderizar.Add(Mesh); } cabaniaBoundingBox = new TgcBoundingAxisAlignBox(new TGCVector3(-500, 20, 500), new TGCVector3(0, 1001, 1080)); var sceneBridge = loader.loadSceneFromFile(MediaDir + @"Bridge-TgcScene.xml"); foreach (var Mesh in sceneBridge.Meshes) { Mesh.Move(-2561, 12, 159); Mesh.Scale = new TGCVector3(4.5f, .75f, 1.35f); Mesh.Transform = TGCMatrix.Scaling(Mesh.Scale); Objetos.Add(new SinEfecto(Mesh)); MeshARenderizar.Add(Mesh); } var sceneCanoa = loader.loadSceneFromFile(MediaDir + @"Canoa-TgcScene.xml"); foreach (var Mesh in sceneCanoa.Meshes) { Mesh.Move(-482, 20, -3110); Mesh.Scale = new TGCVector3(1.5f, 1.5f, 1.5f); Mesh.Transform = TGCMatrix.Scaling(Mesh.Scale); Objetos.Add(new SinEfecto(Mesh)); MeshARenderizar.Add(Mesh); } //Cabania es lugar seguro if (TgcCollisionUtils.testAABBAABB(personaje.mesh.BoundingBox, cabaniaBoundingBox)) { personaje.tiempoDesprotegido = 0; } }
//TODO: manejar todos los mesh de cada parcela en una una coleccion public SideLeft(TGCVector3 Position, TgcPlane grassPlane, TgcTexture wallTexture, TgcPlane columnPlaneX, TgcPlane columnPlaneZ, TgcPlane topPlane, TgcMesh plantModel) { this.Position = Position; //Se define el terrno de la parcela var grassMesh = grassPlane.toMesh("floor"); grassMesh.Position = this.Position; grassMesh.Transform = TGCMatrix.Translation(grassMesh.Position); meshes.Add(grassMesh); //Variable temporal que contiene el modelo var basePlant = plantModel; basePlant.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z); basePlant.Scale = new TGCVector3(0.5f, 0.5f, 0.5f); var random = new Random(); var ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.Enabled = true; basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaabajo2"); basePlant.Position = new TGCVector3(Position.X + 25, Position.Y, Position.Z + 5); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaabajo4"); basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 5); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba1"); basePlant.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba3"); basePlant.Position = new TGCVector3(Position.X + 25, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); basePlant = basePlant.clone("plantaarriba5"); basePlant.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z + 45); ran = random.Next(0, 100); basePlant.RotateY(ran); basePlant.UpdateMeshTransform(); plantas.Add(basePlant); //Armamos muros a partir de un Plano y lo convertimos a Mesh var baseTriangleWallH = new TgcPlane(new TGCVector3(), new TGCVector3(50, 20.62f, 0), TgcPlane.Orientations.XYplane, wallTexture, 2, 1); var wallMesh = baseTriangleWallH.toMesh("WallHA"); wallMesh.RotateX(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 5); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("WallHB"); wallMesh.RotateX(FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); var baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20.62f, 50), TgcPlane.Orientations.YZplane, wallTexture, 2, 1); wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); //Columnas var column = new Column { Position = this.Position }; meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, TGCVector3.Empty)); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(0, 0, 45))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 0))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 45))); //Tapas de columnas baseWall = topPlane; wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); }
public override void RenderScene() { var l = ClosestLight(); shadowEffect.SetValue("EPSILON", l.Item1); skeletalShadowEffect.SetValue("EPSILON", l.Item1); g_LightPos = l.Item2; g_LightDir = l.Item3; // Cargar variables de shader, por ejemplo el tiempo transcurrido. time += Env.ElapsedTime; shaderArbustos.SetValue("time", time); shaderLiquidos.SetValue("time", time); shaderAceites.SetValue("time", time); PisoAcidoMesh = PisoAcido.toMesh("acido"); PisoAcidoMesh.Effect = shaderLiquidos; PisoAcidoMesh.Technique = "RenderScene"; PisoAcidoMesh.Render(); foreach (TgcMesh aceite in ListaPisosResbalosos) { aceite.Effect = shaderAceites; aceite.Technique = "RenderScene"; aceite.Render(); } foreach (TgcMesh arbusto in Scene.Meshes.FindAll(m => m.Name.Contains("Arbusto") || m.Name.Contains("Flores") || m.Name.Contains("Arbol"))) { arbusto.Effect = shaderArbustos; arbusto.Technique = "RenderScene"; arbusto.Render(); } baseRender(); foreach (var plano in ListaPlanos) { RenderObject(plano); } foreach (var plano in ListaPlanoAcido) { RenderObject(plano); } foreach (var piso in ListaPisosSubterraneos) { RenderObject(piso); } rotacionLogos += 1f * Env.ElapsedTime; rotacionLogos = rotacionLogos > 360f ? 0 : rotacionLogos; foreach (var logo in ListaLogos) { var p = (logo.BoundingBox.PMax + logo.BoundingBox.PMin) * 0.5f; logo.AutoTransform = false; logo.Transform = TGCMatrix.Translation(-p) * TGCMatrix.RotationYawPitchRoll(rotacionLogos, 0, 0) * TGCMatrix.Translation(p); } TextoLogo.Text = CantLogos.ToString(); TextoLogo.render(); Env.Personaje.Render(this); }
public Fin(TGCVector3 Position, TgcPlane grassPlane, string wallTexture, string columnTexture, TgcPlane topPlane) { this.Position = Position; //Se define el terrno de la parcela var grassMesh = grassPlane.toMesh("floor"); grassMesh.Position = this.Position; grassMesh.Transform = TGCMatrix.Translation(grassMesh.Position); meshes.Add(grassMesh); #region Paredes var baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20f, 50), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(wallTexture), 2, 1); var wallMesh = baseWall.toMesh("WallVA"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.Position = new TGCVector3(Position.X + 50, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); var baseTriangleWallH = new TgcPlane(new TGCVector3(), new TGCVector3(50, 20f, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseTriangleWallH.toMesh("WallHA"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 37.5f); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("Wall45"); wallMesh.RotateY(FastMath.ToRad(45)); wallMesh.Position = new TGCVector3(Position.X + 25, Position.Y, Position.Z + 50); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("Wall135"); wallMesh.RotateY(FastMath.ToRad(90)); wallMesh.Position = new TGCVector3(Position.X + 25, Position.Y, Position.Z + 50); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); #endregion #region Columnas //Columnas baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(Position.X + 5, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1H1"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 5); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1H2"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); //Este queda baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column2V1"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column2H1"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z + 5); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column2H2"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y, Position.Z + 5); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); #endregion //Tapas de columnas baseWall = topPlane; wallMesh = baseWall.toMesh("TopColumn3"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); }
public override void Init() { var d3dDevice = D3DDevice.Instance.Device; moto = new Moto(MediaDir, new Vector3(0, 0, 0)); moto.init(); texturaPiso = TgcTexture.createTexture(D3DDevice.Instance.Device, MediaDir + "SkyBoxTron\\bottom.png"); pisoPlane = new TgcPlane(); pisoPlane.Origin = new Vector3(-5000, 0, -5000); pisoPlane.Size = new Vector3(10000, 0, 10000); pisoPlane.Orientation = TgcPlane.Orientations.XZplane; pisoPlane.setTexture(texturaPiso); pisoPlane.updateValues(); piso = pisoPlane.toMesh("piso"); piso.AutoTransformEnable = true; camaraInterna = new camara(moto); Camara = camaraInterna; camaraInterna.rotateY(FastMath.ToRad(180)); skyBoxTron = new SkyBox(MediaDir); skyBoxTron.init(); texto = new TgcText2D(); texto.Color = Color.Red; texto.Align = TgcText2D.TextAlign.LEFT; texto.Text = "Perdiste, toca la tecla R para reiniciar"; texto.Size = new Size(700, 400); texto.Position = new Point(550, 150); textoModoDios = new TgcText2D(); textoModoDios.Color = Color.Red; textoModoDios.Text = "Modo Dios Activado"; textoModoDios.Position = new Point(0, 30); textoModoDios.Size = new Size(500, 200); controladorIA = new ControladorIA(); this.generarOponentes(); perdido = false; cajas = new List <TgcMesh>(); cajaConLuz = new TgcSceneLoader().loadSceneFromFile(MediaDir + Game.Default.pathCajaMetalica).Meshes[0]; cajaConLuz.Position = new Vector3(0, 0, -200); cajaConLuz.Scale = new Vector3(0.8f, 0.8f, 0.8f); efectoLuz = TgcShaders.loadEffect(ShadersDir + "MultiDiffuseLights.fx"); this.generarCajas(100); controladorIA.setObstaculosEscenario(cajas); gestorPowerUps = new GestorPowerUps(); mp3Player = new TgcMp3Player(); mp3Player.closeFile(); mp3Player.FileName = MediaDir + Game.Default.pathMusica; mp3Player.play(true); }
public Inicio(TGCVector3 Position, TgcPlane grassPlane, TgcTexture wallTexture, TgcPlane columnPlaneX, TgcPlane columnPlaneZ, TgcPlane topPlane) { this.Position = Position; //Se define el terrno de la parcela var grassMesh = grassPlane.toMesh("floor"); grassMesh.Position = this.Position; grassMesh.Transform = TGCMatrix.Translation(grassMesh.Position); meshes.Add(grassMesh); #region Paredes var baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20f, 50), TgcPlane.Orientations.YZplane, wallTexture, 2, 1); var wallMesh = baseWall.toMesh("WallVA"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.Position = new TGCVector3(Position.X + 50, Position.Y, Position.Z); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); var baseTriangleWallH = new TgcPlane(new TGCVector3(), new TGCVector3(50, 20f, 0), TgcPlane.Orientations.XYplane, wallTexture, 2, 1); wallMesh = baseTriangleWallH.toMesh("WallHA"); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 12.5f); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("Wall45"); wallMesh.RotateY(FastMath.ToRad(45)); wallMesh.Position = new TGCVector3(Position.X, Position.Y, Position.Z + 25); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("Wall135"); wallMesh.RotateY(FastMath.ToRad(90)); wallMesh.Position = new TGCVector3(Position.X + 50, Position.Y, Position.Z + 25); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); #endregion #region Columnas //Columnas var column = new Column { Position = this.Position }; meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, TGCVector3.Empty)); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(0, 0, 45))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 0))); meshes.AddRange(column.CreateColumn(columnPlaneX, columnPlaneZ, new TGCVector3(45, 0, 45))); #endregion //Tapas de columnas baseWall = topPlane; wallMesh = baseWall.toMesh("TopColumn3"); wallMesh.Position = new TGCVector3(Position.X + 45, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(Position.X, Position.Y + 20, Position.Z + 45); wallMesh.UpdateMeshTransform(); meshes.Add(wallMesh); }
public Temple(Vector3 position, string wallTexture, string columnTexture, string topWall, string topTexture, string floorTexture) { #region 1er Piso //1er Piso var baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20.62f, 100), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(wallTexture), 2, 1); var wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.RotateZ(FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 100, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(100, 20.62f, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 100); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(90, 0, 90), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(floorTexture), 2, 2); wallMesh = baseWall.toMesh("Floor"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y + 20, position.Z + 5); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); #endregion #region 2do Piso //2Piso baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20.62f, 80), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.RotateZ(FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 90, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(80, 20.62f, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 90); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(70, 0, 70), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(floorTexture), 2, 2); wallMesh = baseWall.toMesh("Floor"); wallMesh.Position = new TGCVector3(position.X + 15, position.Y + 40, position.Z + 15); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); #endregion #region 3er Piso //3Piso baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20.62f, 60), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("WallVA"); wallMesh.RotateZ(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("WallVB"); wallMesh.RotateZ(FastMath.ToRad(4 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 80, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(60, 20.62f, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = baseWall.toMesh("WallHA"); wallMesh.RotateX(-FastMath.ToRad(2 * 7.125f)); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 80); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(50, 0, 50), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(floorTexture), 2, 2); wallMesh = baseWall.toMesh("Floor"); wallMesh.Position = new TGCVector3(position.X + 25, position.Y + 60, position.Z + 25); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); #endregion #region Tope //Tope baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 45); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 65); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 45); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(10, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 65); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 45, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 65, position.Y + 60, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 65, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 10), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 55, position.Y + 60, position.Z + 55); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(30, 0, 30), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("Floor"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 80, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(30, 5, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(topWall), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 80, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(30, 5, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(topWall), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 80, position.Z + 65); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 5, 30), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(topWall), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 80, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 5, 30), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(topWall), 2, 1); wallMesh = baseWall.toMesh("TopWall"); wallMesh.Position = new TGCVector3(position.X + 65, position.Y + 80, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(30, 0, 30), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(wallTexture), 2, 1); wallMesh = baseWall.toMesh("Floor"); wallMesh.Position = new TGCVector3(position.X + 35, position.Y + 85, position.Z + 35); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); #endregion #region Columnas //Columnas //1er Piso baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X, position.Y, position.Z + 100); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z + 5); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y, position.Z + 100); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); //2do Piso baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 15, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100 - 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 15, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100 - 10, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 5 + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 20, position.Z + 100 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 5 + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 20, position.Z + 100 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); //3er Piso baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(0, 20, 5), TgcPlane.Orientations.YZplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5 + 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100 - 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 5 + 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 100 - 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 20, 0), TgcPlane.Orientations.XYplane, TgcTexture.createTexture(columnTexture), 1, 1); wallMesh = baseWall.toMesh("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 5 + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 40, position.Z + 100 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 5 + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("Column1V1"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 40, position.Z + 100 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); //Tapas baseWall = new TgcPlane(new TGCVector3(), new TGCVector3(5, 0, 5), TgcPlane.Orientations.XZplane, TgcTexture.createTexture(topTexture), 1, 1); wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(position.X, position.Y + 20, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y + 20, position.Z); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(position.X + 95, position.Y + 20, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(position.X, position.Y + 20, position.Z + 95); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 40, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 40, position.Z + 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(position.X + 95 - 10, position.Y + 40, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(position.X + 10, position.Y + 40, position.Z + 95 - 10); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = baseWall.toMesh("TopColumn1"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 60, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn2"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 60, position.Z + 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn3"); wallMesh.Position = new TGCVector3(position.X + 95 - 20, position.Y + 60, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); wallMesh = wallMesh.clone("TopColumn4"); wallMesh.Position = new TGCVector3(position.X + 20, position.Y + 60, position.Z + 95 - 20); wallMesh.UpdateMeshTransform(); templeWalls.Add(wallMesh); #endregion }