private GeometryNode ShootBullet; //Geometry for Bullet #endregion Fields #region Constructors public Bullet(Vector3 InitPos, PrimitiveModel BulletModel, Material Material, Vector3 DirBullet, MarkerNode grdMarkerNode) { //Create Bullet ShootBullet = new GeometryNode(); ShootBullet.Name = "ShootBullet" + ShootBullet.ID; ShootBullet.Model = BulletModel; ShootBullet.Material = Material; ShootBullet.Physics.Interactable = true; ShootBullet.Physics.Collidable = true; ShootBullet.Physics.Shape = GoblinXNA.Physics.ShapeType.Box; ShootBullet.Physics.Mass = 60f; ShootBullet.Physics.MaterialName = "Bullet"; ShootBullet.AddToPhysicsEngine = true; // Assign the initial velocity to this shooting box ShootBullet.Physics.InitialLinearVelocity = new Vector3(DirBullet.X * 80, DirBullet.Y * 80, DirBullet.Z * 50); BulletTrans = new TransformNode(); BulletTrans.Translation = InitPos; grdMarkerNode.AddChild(BulletTrans); BulletTrans.AddChild(ShootBullet); //Normal asignament isvisible = true; //Agrego Segundo desde que se creo livetime = Convert.ToInt32(DateTime.Now.TimeOfDay.TotalSeconds) + BULLET_TIMELIVE; }
private void CreateObjects() { // Create a geometry node with a model of a sphere that will be overlaid on // top of the ground marker array GeometryNode sphereNode = new GeometryNode("Sphere"); // We will use TexturedSphere instead of regular Box class since we will need the // texture coordinates elements for passing the vertices to the SimpleShadowShader // we will be using sphereNode.Model = new TexturedSphere(16, 20, 20); // Add this sphere model to the physics engine for collision detection sphereNode.AddToPhysicsEngine = true; sphereNode.Physics.Shape = ShapeType.Sphere; // Make this sphere model cast and receive shadows sphereNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast; // Assign a shadow shader for this model that uses the IShadowMap we assigned to the scene sphereNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap); // Create a marker node to track a ground marker array. #if USE_NYARTOOLKIT groundMarkerNode = new MarkerNode(scene.MarkerTracker, "NyARToolkitGroundArray.xml", NyARToolkitTracker.ComputationMethod.Average); #else groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARGroundArray.xml"); #endif TransformNode sphereTransNode = new TransformNode(); sphereTransNode.Translation = new Vector3(0, 0, 50); // Create a material to apply to the sphere model Material sphereMaterial = new Material(); sphereMaterial.Diffuse = new Vector4(0, 0.5f, 0, 1); sphereMaterial.Specular = Color.White.ToVector4(); sphereMaterial.SpecularPower = 10; sphereNode.Material = sphereMaterial; // Now add the above nodes to the scene graph in the appropriate order. // Note that only the nodes added below the marker node are affected by // the marker transformation. scene.RootNode.AddChild(groundMarkerNode); groundMarkerNode.AddChild(sphereTransNode); sphereTransNode.AddChild(sphereNode); // Create a geometry node with a model of a box that will be overlaid on // top of the ground marker array initially. (When the toolbar marker array is // detected, it will be overlaid on top of the toolbar marker array.) boxNode = new GeometryNode("Box"); // We will use TexturedBox instead of regular Box class since we will need the // texture coordinates elements for passing the vertices to the SimpleShadowShader // we will be using boxNode.Model = new TexturedBox(32.4f); // Add this box model to the physics engine for collision detection boxNode.AddToPhysicsEngine = true; boxNode.Physics.Shape = ShapeType.Box; // Make this box model cast and receive shadows boxNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast; // Assign a shadow shader for this model that uses the IShadowMap we assigned to the scene boxNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap); // Create a marker node to track a toolbar marker array. #if USE_NYARTOOLKIT toolbarMarkerNode = new MarkerNode(scene.MarkerTracker, "ToolbarNyARToolkit.xml", NyARToolkitTracker.ComputationMethod.Average); #else toolbarMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARToolbar.xml"); #endif scene.RootNode.AddChild(toolbarMarkerNode); // Create a material to apply to the box model Material boxMaterial = new Material(); boxMaterial.Diffuse = new Vector4(0.5f, 0, 0, 1); boxMaterial.Specular = Color.White.ToVector4(); boxMaterial.SpecularPower = 10; boxNode.Material = boxMaterial; // Add this box model node to the ground marker node groundMarkerNode.AddChild(boxNode); // Create a collision pair and add a collision callback function that will be // called when the pair collides NewtonPhysics.CollisionPair pair = new NewtonPhysics.CollisionPair(boxNode.Physics, sphereNode.Physics); ((NewtonPhysics)scene.PhysicsEngine).AddCollisionCallback(pair, BoxSphereCollision); }
private void CreateMarkerTracking() { Console.WriteLine(DateTime.Now.ToString() + " Setup Markers\n"); // Create a marker node to track a ground marker array. groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARGroundArray.xml"); //Add marker to Scene scene.RootNode.AddChild(groundMarkerNode); /***** For Weapons *****/ //Add Big Parent for All Weapons parentTNodeWeapon = new TransformNode(); parentTNodeWeapon.Name = "Weapons"; groundMarkerNode.AddChild(parentTNodeWeapon); /***** For Cars *****/ parentTNodeCars = new TransformNode(); parentTNodeCars.Name = "TCars"; groundMarkerNode.AddChild(parentTNodeCars); /************** Array of markers **************/ int HinIdx, MarkIdx = 29; //Add Markers with the Code Index between 29 - 32 for the Weapons (one for player) for (HinIdx = 0; HinIdx < Max_palyer; HinIdx++) { WeaponMarkeNodes[HinIdx] = new MarkerNode(scene.MarkerTracker, MarkIdx); scene.RootNode.AddChild(WeaponMarkeNodes[HinIdx]); MarkIdx++; } //Add Markers with the Code Index between 33 - 38 for the Obstacles for (HinIdx = 0; HinIdx < Max_Markers; HinIdx++) { HinderMarkeNodes[HinIdx] = new MarkerNode(scene.MarkerTracker, MarkIdx); scene.RootNode.AddChild(HinderMarkeNodes[HinIdx]); MarkIdx++; } }
TransformNode parentTNodeGrd; //Parent for all Scene Objects #endregion Fields #region Constructors public Graphics3D(MarkerNode MarkerNode, IShadowMap ShadowMap) { //Asignation Ground Node this.groundMarkerNode = MarkerNode; //Asignation Shadow Map this.GShadowMap = ShadowMap; //Add Big Parent for All Scenary Elements parentTNodeGrd = new TransformNode(); parentTNodeGrd.Name = "Level"; groundMarkerNode.AddChild(parentTNodeGrd); // Create a material for the model BulletrMat = new Material(); BulletrMat.Diffuse = Color.Blue.ToVector4(); BulletrMat.Specular = Color.White.ToVector4(); BulletrMat.SpecularPower = 10; //create Bullet Model BulletModel = new TexturedBox(2.0f); LoadLevel = false; LoadCars = false; }
/********************* Basic Elements ****************/ public GeometryNode CreateCube(MarkerNode Marker, Vector4 CubeColor) { GeometryNode boxNode; // Create a geometry node with a model of a box boxNode = new GeometryNode("Box"); boxNode.Model = new TexturedBox(32.4f); // Add this box model to the physics engine for collision detection boxNode.AddToPhysicsEngine = true; boxNode.Physics.Shape = ShapeType.Box; // Make this box model cast and receive shadows boxNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast; // Assign a shadow shader for this model that uses the IShadowMap we assigned to the scene boxNode.Model.Shader = new SimpleShadowShader(GShadowMap); // Create a material to apply to the box model Material boxMaterial = new Material(); boxMaterial.Diffuse = CubeColor; boxMaterial.Specular = Color.White.ToVector4(); boxMaterial.SpecularPower = 10; boxNode.Material = boxMaterial; // Add this box model node to the ground marker node Marker.AddChild(boxNode); return boxNode; // Create a collision pair and add a collision callback function that will be // called when the pair collides //NewtonPhysics.CollisionPair pair = new NewtonPhysics.CollisionPair(boxNode.Physics, sphereNode.Physics); //((NewtonPhysics)scene.PhysicsEngine).AddCollisionCallback(pair, BoxSphereCollision); }
public static void CreateBall(MarkerNode Marker) { // Create a geometry node for Sphere PrimitiveModel PsphereModel = new Sphere(15f, 20, 20); // Create a material to apply to the sphere model Material sphereMaterial = new Material(); sphereMaterial.Diffuse = new Vector4(0, 0.5f, 0, 1); sphereMaterial.Specular = Color.White.ToVector4(); sphereMaterial.SpecularPower = 10; GeometryNode sphereNode = new GeometryNode("Sphere"); //sphereNode.Model = new TexturedSphere(16, 20, 20); sphereNode.Model = PsphereModel; sphereNode.Material = sphereMaterial; // Add this sphere model to the physics engine for collision detection sphereNode.Physics.Interactable = true; sphereNode.Physics.Collidable = true; sphereNode.Physics.Shape = ShapeType.Sphere; sphereNode.Physics.Mass = 30; //sphereNode.Physics.ApplyGravity = false; sphereNode.Physics.InitialLinearVelocity = new Vector3(30, 0, 0); //sphereNode.Physics.MaterialName = "Sphere"; //sphereNode.Physics.ApplyGravity = true; sphereNode.AddToPhysicsEngine = true; // Make this sphere model cast and receive shadows //sphereNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast; // Assign a shadow shader for this model that uses the IShadowMap we assigned to the scene //sphereNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap); TransformNode sphereTransNode = new TransformNode(); sphereTransNode.Translation = new Vector3(50, 0, 50); // Now add the above nodes to the scene graph in the appropriate order. // Note that only the nodes added below the marker node are affected by // the marker transformation. Marker.AddChild(sphereTransNode); sphereTransNode.AddChild(sphereNode); }
public static GeometryNode AddModel(MarkerNode Marker, String Folder, String Model, bool IntMaterial, float Scala) { GeometryNode ObstNode; if (Model == "null") return ObstNode = new GeometryNode(); ObstNode = Graphics3D.LoadModel("Models/" + Folder, Model, IntMaterial); //define the Physic Material name ObstNode.Physics.MaterialName = "Obstacle"; TransformNode parentTransNode = new TransformNode(); parentTransNode.Name = Model; parentTransNode.Scale = new Vector3(Scala, Scala + 2, Scala); parentTransNode.Rotation = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), MathHelper.ToRadians(90)); //Add Rotation because Blender Axis parentTransNode.AddChild(ObstNode); // Add this box model node to the ground marker node if(Marker != null) Marker.AddChild(parentTransNode); return ObstNode; }
public Catalog(Scene s) { this.my_scene = s; this.marker = new MarkerNode(my_scene.MarkerTracker, "palette_marker.xml"); this.changeMarker = new MarkerNode(my_scene.MarkerTracker, "palette_turn_marker.xml"); my_scene.RootNode.AddChild(marker); my_scene.RootNode.AddChild(changeMarker); library = new ItemLibrary("models.txt"); names2itemsInCatalog = new Dictionary<string, Item>(); names2itemsInRoom = new Dictionary<string, Item>(); item_list = library.getAllItems(); // this.objects = l; int grid_x = 0; int grid_y = 0; foreach (Item i in item_list) { names2itemsInCatalog.Add(i.Label, i); i.setGroupID(catalogGroupID); i.Scale = new Vector3(9.0f, 9.0f, 9.0f) / i.Radius; } for (int i = cur_start; i < cur_end && i < item_list.Count; i++) { if (grid_x > 15) { grid_x = 0; grid_y -= 15; } item_list[i].BindTo(marker); item_list[i].MoveTo(new Vector3(grid_x, grid_y, 0)); grid_x += 15; } // Create a geometry node with a model of box GeometryNode boxNode = new GeometryNode("Box"); boxNode.Model = new Box(30,30,0.1f); TransformNode boxTransNode = new TransformNode(); boxTransNode.AddChild(boxNode); boxTransNode.Translation += new Vector3(6, -6, -0.5f); Material boxMat = new Material(); boxMat.Diffuse = Color.DimGray.ToVector4(); boxNode.Material = boxMat; marker.AddChild(boxTransNode); }
private void CreateObjects() { // Create a material to apply to the sphere model Material sphereMaterial = new Material(); sphereMaterial.Diffuse = new Vector4(0, 0.5f, 0, 1); sphereMaterial.Specular = Color.Green.ToVector4(); sphereMaterial.SpecularPower = 10; Material sphereMaterial2 = new Material(); sphereMaterial2.Diffuse = new Vector4(0, 0, 0.5f, 1); sphereMaterial2.Specular = Color.Blue.ToVector4(); sphereMaterial2.SpecularPower = 10; Material sphereMaterial3 = new Material(); sphereMaterial3.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial3.Specular = Color.Red.ToVector4(); sphereMaterial3.SpecularPower = 10; Material sphereMaterial4 = new Material(); sphereMaterial4.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial4.Specular = Color.Cyan.ToVector4(); sphereMaterial4.SpecularPower = 10; Material sphereMaterial5 = new Material(); sphereMaterial5.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial5.Specular = Color.Magenta.ToVector4(); sphereMaterial5.SpecularPower = 10; Material sphereMaterial6 = new Material(); sphereMaterial6.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial6.Specular = Color.Yellow.ToVector4(); sphereMaterial6.SpecularPower = 10; Material sphereMaterial7 = new Material(); sphereMaterial7.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial7.Specular = Color.DarkGray.ToVector4(); sphereMaterial7.SpecularPower = 10; Material sphereMaterial8 = new Material(); sphereMaterial8.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial8.Specular = Color.Orange.ToVector4(); sphereMaterial8.SpecularPower = 10; Material sphereMaterial9 = new Material(); sphereMaterial9.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial9.Specular = Color.Purple.ToVector4(); sphereMaterial9.SpecularPower = 10; Material sphereMaterial10 = new Material(); sphereMaterial10.Diffuse = new Vector4(0.5f, 0, 0, 1); sphereMaterial10.Specular = Color.Pink.ToVector4(); sphereMaterial10.SpecularPower = 10; int[] zero = new int[1]; int[] first = new int[1]; int[] two = new int[1]; int[] three = new int[1]; int[] four = new int[1]; int[] five = new int[1]; int[] six = new int[1]; int[] seven = new int[1]; int[] eight = new int[1]; int[] nine = new int[1]; int[] ten = new int[1]; int[] eleven = new int[1]; int[] twelve = new int[1]; int[] thirteen = new int[1]; int[] fourteen = new int[1]; int[] fifteen = new int[1]; int[] sixteen = new int[1]; int[] seventeen = new int[1]; int[] eighteen = new int[1]; int[] nineteen = new int[1]; int[] twenty = new int[1]; int[] twentyone = new int[1]; int[] twentytwo = new int[1]; int[] twentythree = new int[1]; int[] twentyfour = new int[1]; int[] twentyfive = new int[1]; int[] twentysix = new int[1]; int[] twentyseven = new int[1]; int[] twentyeight = new int[1]; int[] twentynine = new int[1]; int[] thirty = new int[1]; int[] thirtyone = new int[1]; int[] thirtytwo = new int[1]; int[] thirtythree = new int[1]{133}; int[] thirtyfour = new int[1]{134}; int[] thirtyfive = new int[1]{135}; int[] thirtysix = new int[1]{136}; int[] thirtyseven = new int[1]{137}; int[] thirtyeight = new int[1] { 138 }; int[] thirtynine = new int[1] { 139 }; int[] forty = new int[1] { 140 }; int[] fortyone = new int[1] { 141 }; zero[0] = 100; first[0] = 101; two[0] = 102; three[0] = 103; four[0] = 104; five[0] = 105; six[0] = 106; seven[0] = 107; eight[0] = 108; nine[0] = 100; ten[0] = 110; eleven[0] = 111; twelve[0] = 112; thirteen[0] = 113; fourteen[0] = 114; fifteen[0] = 115; sixteen[0] = 116; seventeen[0] = 117; eighteen[0] = 118; nineteen[0] = 119; twenty[0] = 120; twentyone[0] = 121; twentytwo[0] = 122; twentythree[0] = 123; twentyfour[0] = 124; twentyfive[0] = 125; twentysix[0] = 126; twentyseven[0] = 127; twentyeight[0] = 128; twentynine[0] = 129; thirty[0] = 130; thirtyone[0] = 131; thirtytwo[0] = 132; ModelLoader loader = new ModelLoader(); Model trapModel0 = (Model)loader.Load("", "Boxwhite"); Model trapModel1 = (Model)loader.Load("", "Boxwhite"); Model trapModel2 = (Model)loader.Load("", "Boxwhite"); Model trapModel3 = (Model)loader.Load("", "Boxwhite"); Model trapModel4 = (Model)loader.Load("", "Boxwhite"); Model trapModel5 = (Model)loader.Load("", "Boxwhite"); Model trapModel6 = (Model)loader.Load("", "Boxwhite"); Model trapModel7 = (Model)loader.Load("", "Boxwhite"); Model trapModel8 = (Model)loader.Load("", "Boxwhite"); Model trapModel9 = (Model)loader.Load("", "Boxwhite"); Model spellModel0 = (Model)loader.Load("", "MagicHat"); Model spellModel1 = (Model)loader.Load("", "MagicHat"); Model spellModel2 = (Model)loader.Load("", "MagicHat"); Model spellModel3 = (Model)loader.Load("", "MagicHat"); Model spellModel4 = (Model)loader.Load("", "MagicHat"); Model spellModel5 = (Model)loader.Load("", "MagicHat"); Model spellModel6 = (Model)loader.Load("", "MagicHat"); Model spellModel7 = (Model)loader.Load("", "MagicHat"); Model spellModel8 = (Model)loader.Load("", "MagicHat"); Model spellModel9 = (Model)loader.Load("", "MagicHat"); Model monsterModel0 = (Model)loader.Load("", "Slime"); Model monsterModel1 = (Model)loader.Load("", "Slime"); Model monsterModel2 = (Model)loader.Load("", "Slime"); Model monsterModel3 = (Model)loader.Load("", "Slime"); Model monsterModel4 = (Model)loader.Load("", "Slime"); Model monsterModel5 = (Model)loader.Load("", "Slime"); Model monsterModel6 = (Model)loader.Load("", "Slime"); Model monsterModel7 = (Model)loader.Load("", "Slime"); Model monsterModel8 = (Model)loader.Load("", "Slime"); Model monsterModel9 = (Model)loader.Load("", "Slime"); //Marker 100 cylinderMarkerNode100 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML100.xml", zero); GeometryNode cylinderNode0 = new GeometryNode("Cylinder"); cylinderNode0.Model = monsterModel0; ((Model)cylinderNode0.Model).UseInternalMaterials = false; cylinderNode0.Material = sphereMaterial; TransformNode cylinderTransNode0 = new TransformNode(); cylinderTransNode0.Scale = new Vector3(5, 5, 5); cylinderTransNode0.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode100.AddChild(cylinderTransNode0); cylinderTransNode0.AddChild(cylinderNode0); //add to Card array here: generic monster card here cards[0] = new Card('M', cylinderMarkerNode100, 90, 125, "Tethys, Goddess of Light", "Attack"); //Marker 101 cylinderMarkerNode101 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML101.xml", first); GeometryNode cylinderNode1 = new GeometryNode("Cylinder"); cylinderNode1.Model = monsterModel1; ((Model)cylinderNode1.Model).UseInternalMaterials = false; cylinderNode1.Material = sphereMaterial2; TransformNode cylinderTransNode1 = new TransformNode(); cylinderTransNode1.Scale = new Vector3(5, 5, 5); cylinderTransNode1.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode101.AddChild(cylinderTransNode1); cylinderTransNode1.AddChild(cylinderNode1); //add to Card array here: generic monster card here cards[1] = new Card('M', cylinderMarkerNode101, 120, 150, "Athena", "Attack"); //Marker 102 cylinderMarkerNode102 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML102.xml", two); GeometryNode cylinderNode2 = new GeometryNode("Cylinder"); cylinderNode2.Model = monsterModel2; ((Model)cylinderNode2.Model).UseInternalMaterials = false; cylinderNode2.Material = sphereMaterial3; TransformNode cylinderTransNode2 = new TransformNode(); cylinderTransNode2.Scale = new Vector3(5, 5, 5); cylinderTransNode2.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode102.AddChild(cylinderTransNode2); cylinderTransNode2.AddChild(cylinderNode2); //add to Card array here: generic monster card here cards[2] = new Card('M', cylinderMarkerNode102, 105, 120, "Victoria", "Attack"); //Marker 103 cylinderMarkerNode103 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML103.xml", three); GeometryNode cylinderNode3 = new GeometryNode("Cylinder"); cylinderNode3.Model = monsterModel3; ((Model)cylinderNode3.Model).UseInternalMaterials = false; cylinderNode3.Material = sphereMaterial4; TransformNode cylinderTransNode3 = new TransformNode(); cylinderTransNode3.Scale = new Vector3(5, 5, 5); cylinderTransNode3.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode103.AddChild(cylinderTransNode3); cylinderTransNode3.AddChild(cylinderNode3); //add to Card array here: generic monster card here cards[3] = new Card('M', cylinderMarkerNode103, 130, 160, "The Agent of Force - Mars", "Attack"); //Marker 104 cylinderMarkerNode104 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML104.xml", four); GeometryNode cylinderNode4 = new GeometryNode("Cylinder"); cylinderNode4.Model = monsterModel4; ((Model)cylinderNode4.Model).UseInternalMaterials = false; cylinderNode4.Material = sphereMaterial5; TransformNode cylinderTransNode4 = new TransformNode(); cylinderTransNode4.Scale = new Vector3(5, 5, 5); cylinderTransNode4.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode104.AddChild(cylinderTransNode4); cylinderTransNode4.AddChild(cylinderNode4); //add to Card array here: generic monster card here cards[4] = new Card('M', cylinderMarkerNode104, 115, 155, "The Agent of Wisdom - Mercury", "Attack"); //Marker 105 cylinderMarkerNode105 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML105.xml", five); GeometryNode cylinderNode5 = new GeometryNode("Cylinder"); cylinderNode5.Model = monsterModel5; ((Model)cylinderNode5.Model).UseInternalMaterials = false; cylinderNode5.Material = sphereMaterial6; TransformNode cylinderTransNode5 = new TransformNode(); cylinderTransNode5.Scale = new Vector3(5, 5, 5); cylinderTransNode5.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode105.AddChild(cylinderTransNode5); cylinderTransNode5.AddChild(cylinderNode5); //add to Card array here: generic monster card here cards[5] = new Card('M', cylinderMarkerNode105, 95, 145, "The Agent of Mystery - Earth", "Attack"); //Marker 106 cylinderMarkerNode106 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML106.xml", six); GeometryNode cylinderNode6 = new GeometryNode("Cylinder"); cylinderNode6.Model = monsterModel6; ((Model)cylinderNode6.Model).UseInternalMaterials = false; cylinderNode6.Material = sphereMaterial7; TransformNode cylinderTransNode6 = new TransformNode(); cylinderTransNode6.Scale = new Vector3(5, 5, 5); cylinderTransNode6.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode106.AddChild(cylinderTransNode6); cylinderTransNode6.AddChild(cylinderNode6); //add to Card array here: generic monster card here cards[6] = new Card('M', cylinderMarkerNode106, 130, 175, "The Agent of Miracles - Jupiter", "Attack"); //Marker 107 cylinderMarkerNode107 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML107.xml", seven); GeometryNode cylinderNode7 = new GeometryNode("Cylinder"); cylinderNode7.Model = monsterModel7; ((Model)cylinderNode7.Model).UseInternalMaterials = false; cylinderNode7.Material = sphereMaterial8; TransformNode cylinderTransNode7 = new TransformNode(); cylinderTransNode7.Scale = new Vector3(5, 5, 5); cylinderTransNode7.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode107.AddChild(cylinderTransNode7); cylinderTransNode7.AddChild(cylinderNode7); //add to Card array here: generic monster card here cards[7] = new Card('M', cylinderMarkerNode107, 80, 120, "The Agent of Judgment - Saturn", "Attack"); //Marker 108 cylinderMarkerNode108 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML108.xml", eight); GeometryNode cylinderNode8 = new GeometryNode("Cylinder"); cylinderNode8.Model = monsterModel8; ((Model)cylinderNode8.Model).UseInternalMaterials = false; cylinderNode8.Material = sphereMaterial9; TransformNode cylinderTransNode8 = new TransformNode(); cylinderTransNode8.Scale = new Vector3(5, 5, 5); cylinderTransNode8.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode108.AddChild(cylinderTransNode8); cylinderTransNode8.AddChild(cylinderNode8); //add to Card array here: generic monster card here cards[8] = new Card('M', cylinderMarkerNode108, 75, 140, "The Agent of Creation - Venus", "Attack"); //Marker 109 cylinderMarkerNode109 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML109.xml", nine); GeometryNode cylinderNode9 = new GeometryNode("Cylinder"); cylinderNode9.Model = monsterModel9; ((Model)cylinderNode9.Model).UseInternalMaterials = false; cylinderNode9.Material = sphereMaterial10; TransformNode cylinderTransNode9 = new TransformNode(); cylinderTransNode9.Scale = new Vector3(5, 5, 5); cylinderTransNode9.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode109.AddChild(cylinderTransNode9); cylinderTransNode9.AddChild(cylinderNode9); //add to Card array here: generic monster card here cards[9] = new Card('M', cylinderMarkerNode109, 150, 200, "Master Hyperion", "Attack"); //Marker 110 cylinderMarkerNode110 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML110.xml", ten); GeometryNode cylinderNode10 = new GeometryNode("Cylinder"); cylinderNode10.Model = spellModel0; ((Model)cylinderNode10.Model).UseInternalMaterials = false; cylinderNode10.Material = sphereMaterial; TransformNode cylinderTransNode10 = new TransformNode(); cylinderTransNode10.Scale = new Vector3(5, 5, 5); cylinderTransNode10.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode110.AddChild(cylinderTransNode10); cylinderTransNode10.AddChild(cylinderNode10); //add to Card array here: generic spell card here cards[10] = new Card('S', cylinderMarkerNode110, 100, 100, "Cards from the Sky", "All of your monsters are healed for 100 hp."); //Marker 111 cylinderMarkerNode111 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML111.xml", eleven); GeometryNode cylinderNode11 = new GeometryNode("Cylinder"); cylinderNode11.Model = spellModel1; ((Model)cylinderNode11.Model).UseInternalMaterials = false; cylinderNode11.Material = sphereMaterial2; TransformNode cylinderTransNode11 = new TransformNode(); cylinderTransNode11.Scale = new Vector3(5, 5, 5); cylinderTransNode11.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode111.AddChild(cylinderTransNode11); cylinderTransNode11.AddChild(cylinderNode11); //add to Card array here: generic spell card here cards[11] = new Card('S', cylinderMarkerNode111, 100, 100, "Valhalla, Hall of the Fallen", "All of your monsters are completly healed."); //Marker 112 cylinderMarkerNode112 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML112.xml", twelve); GeometryNode cylinderNode12 = new GeometryNode("Cylinder"); cylinderNode12.Model = spellModel2; ((Model)cylinderNode12.Model).UseInternalMaterials = false; cylinderNode12.Material = sphereMaterial3; TransformNode cylinderTransNode12 = new TransformNode(); cylinderTransNode12.Scale = new Vector3(5, 5, 5); cylinderTransNode12.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode112.AddChild(cylinderTransNode12); cylinderTransNode12.AddChild(cylinderNode12); //add to Card array here: generic spell card here cards[12] = new Card('S', cylinderMarkerNode112, 100, 100, "Terraforming", "All of your monsters are healed for 1 hp."); //Marker 113 cylinderMarkerNode113 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML113.xml", thirteen); GeometryNode cylinderNode13 = new GeometryNode("Cylinder"); cylinderNode13.Model = spellModel3; ((Model)cylinderNode13.Model).UseInternalMaterials = false; cylinderNode13.Material = sphereMaterial4; TransformNode cylinderTransNode13 = new TransformNode(); cylinderTransNode13.Scale = new Vector3(5, 5, 5); cylinderTransNode13.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode113.AddChild(cylinderTransNode13); cylinderTransNode13.AddChild(cylinderNode13); //add to Card array here: generic spell card here cards[13] = new Card('S', cylinderMarkerNode113, 100, 100, "Smashing Ground", "All of your monsters are healed for 20 hp."); //Marker 114 cylinderMarkerNode114 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML114.xml", fourteen); GeometryNode cylinderNode14 = new GeometryNode("Cylinder"); cylinderNode14.Model = spellModel4; ((Model)cylinderNode14.Model).UseInternalMaterials = false; cylinderNode14.Material = sphereMaterial5; TransformNode cylinderTransNode14 = new TransformNode(); cylinderTransNode14.Scale = new Vector3(5, 5, 5); cylinderTransNode14.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode114.AddChild(cylinderTransNode14); cylinderTransNode14.AddChild(cylinderNode14); //add to Card array here: generic spell card here cards[14] = new Card('S', cylinderMarkerNode114, 100, 100, "The Sanctuary in the Sky", "All of your monsters are healed for 75 hp."); //Marker 115 cylinderMarkerNode115 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML115.xml", fifteen); GeometryNode cylinderNode15 = new GeometryNode("Cylinder"); cylinderNode15.Model = spellModel5; ((Model)cylinderNode15.Model).UseInternalMaterials = false; cylinderNode15.Material = sphereMaterial6; TransformNode cylinderTransNode15 = new TransformNode(); cylinderTransNode15.Scale = new Vector3(5, 5, 5); cylinderTransNode15.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderMarkerNode115.AddChild(cylinderTransNode15); cylinderTransNode15.AddChild(cylinderNode15); //add to Card array here: generic spell card here cards[15] = new Card('S', cylinderMarkerNode115, 100, 100, "The Sanctuary in the Sky", "All of your monsters are healed for 75 hp."); //Marker 116 cylinderMarkerNode116 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML116.xml", sixteen); GeometryNode cylinderNode16 = new GeometryNode("Cylinder"); cylinderNode16.Model = spellModel6; ((Model)cylinderNode16.Model).UseInternalMaterials = false; cylinderNode16.Material = sphereMaterial7; TransformNode cylinderTransNode16 = new TransformNode(); cylinderTransNode16.Scale = new Vector3(5, 5, 5); cylinderTransNode16.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode16.AddChild(cylinderNode16); cylinderMarkerNode116.AddChild(cylinderTransNode16); //add to Card array here: generic spell card here cards[16] = new Card('S', cylinderMarkerNode116, 100, 100, "Celestial Transformation", "All of your monsters are healed for half of their hp."); //Marker 117 cylinderMarkerNode117 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML117.xml", seventeen); GeometryNode cylinderNode17 = new GeometryNode("Cylinder"); cylinderNode17.Model = spellModel7; ((Model)cylinderNode17.Model).UseInternalMaterials = false; cylinderNode17.Material = sphereMaterial8; TransformNode cylinderTransNode17 = new TransformNode(); cylinderTransNode17.Scale = new Vector3(5, 5, 5); cylinderTransNode17.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode17.AddChild(cylinderNode17); cylinderMarkerNode117.AddChild(cylinderTransNode17); //add to Card array here: generic spell card here cards[17] = new Card('S', cylinderMarkerNode117, 100, 100, "Burial from a Different Dimension", "You're protected from 1 trap."); //Marker 118 cylinderMarkerNode118 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML118.xml", eighteen); GeometryNode cylinderNode18 = new GeometryNode("Cylinder"); cylinderNode18.Model = spellModel8; ((Model)cylinderNode18.Model).UseInternalMaterials = false; cylinderNode18.Material = sphereMaterial9; TransformNode cylinderTransNode18 = new TransformNode(); cylinderTransNode18.Scale = new Vector3(5, 5, 5); cylinderTransNode18.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode18.AddChild(cylinderNode18); cylinderMarkerNode118.AddChild(cylinderTransNode18); //add to Card array here: generic spell card here cards[18] = new Card('S', cylinderMarkerNode118, 100, 100, "Mausoleum of the Emperor", "All of your monsters are healed for 75% of their HP."); //Marker 119 cylinderMarkerNode119 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML119.xml", nineteen); GeometryNode cylinderNode19 = new GeometryNode("Cylinder"); cylinderNode19.Model = spellModel9; ((Model)cylinderNode19.Model).UseInternalMaterials = false; cylinderNode19.Material = sphereMaterial10; TransformNode cylinderTransNode19 = new TransformNode(); cylinderTransNode19.Scale = new Vector3(5, 5, 5); cylinderTransNode19.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode19.AddChild(cylinderNode19); cylinderMarkerNode119.AddChild(cylinderTransNode19); //add to Card array here: generic spell card here cards[19] = new Card('S', cylinderMarkerNode119, 100, 100, "The Fountain in the Sky ", "All of your monsters are healed for 25% of their HP."); //Marker 120 cylinderMarkerNode120 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML120.xml", twenty); GeometryNode cylinderNode20 = new GeometryNode("Cylinder"); cylinderNode20.Model = trapModel0; ((Model)cylinderNode20.Model).UseInternalMaterials = false; cylinderNode20.Material = sphereMaterial; TransformNode cylinderTransNode20 = new TransformNode(); cylinderTransNode20.Scale = new Vector3(5, 5, 5); cylinderTransNode20.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode20.AddChild(cylinderNode20); cylinderMarkerNode120.AddChild(cylinderTransNode20); //add to Card array here: generic trap card here cards[20] = new Card('T', cylinderMarkerNode120, 0, 100, "Divine Punishment", "All of your opponent's monsters take damage equal to half of their current health."); //Marker 121 cylinderMarkerNode121 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML121.xml", twentyone); GeometryNode cylinderNode21 = new GeometryNode("Cylinder"); cylinderNode21.Model = trapModel1; ((Model)cylinderNode21.Model).UseInternalMaterials = false; cylinderNode21.Material = sphereMaterial2; TransformNode cylinderTransNode21 = new TransformNode(); cylinderTransNode21.Scale = new Vector3(5, 5, 5); cylinderTransNode21.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode21.AddChild(cylinderNode21); cylinderMarkerNode121.AddChild(cylinderTransNode21); //add to Card array here: generic trap card here cards[21] = new Card('T', cylinderMarkerNode121, 0, 100, "Return from the Different Dimension", "Your opponent may not attack for the remainder of their turn."); //Marker 122 cylinderMarkerNode122 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML122.xml", twentytwo); GeometryNode cylinderNode22 = new GeometryNode("Cylinder"); cylinderNode22.Model = trapModel2; ((Model)cylinderNode22.Model).UseInternalMaterials = false; cylinderNode22.Material = sphereMaterial3; TransformNode cylinderTransNode22 = new TransformNode(); cylinderTransNode22.Scale = new Vector3(5, 5, 5); cylinderTransNode22.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode22.AddChild(cylinderNode22); cylinderMarkerNode122.AddChild(cylinderTransNode22); //add to Card array here: generic trap card here cards[22] = new Card('T', cylinderMarkerNode122, 0, 100, "Torrential Tribute", "Destroy a spell card."); //Marker 123 cylinderMarkerNode123 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML123.xml", twentythree); GeometryNode cylinderNode23 = new GeometryNode("Cylinder"); cylinderNode23.Model = trapModel3; ((Model)cylinderNode23.Model).UseInternalMaterials = false; cylinderNode23.Material = sphereMaterial4; TransformNode cylinderTransNode23 = new TransformNode(); cylinderTransNode23.Scale = new Vector3(5, 5, 5); cylinderTransNode23.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode23.AddChild(cylinderNode23); cylinderMarkerNode123.AddChild(cylinderTransNode23); //add to Card array here: generic trap card here cards[23] = new Card('T', cylinderMarkerNode123, 0, 100, "Beckoning Light", "Your opponent may not activate a trap during your next turn."); //Marker 124 cylinderMarkerNode124 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML124.xml", twentyfour); GeometryNode cylinderNode24 = new GeometryNode("Cylinder"); cylinderNode24.Model = trapModel4; ((Model)cylinderNode24.Model).UseInternalMaterials = false; cylinderNode24.Material = sphereMaterial5; TransformNode cylinderTransNode24 = new TransformNode(); cylinderTransNode24.Scale = new Vector3(5, 5, 5); cylinderTransNode24.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode24.AddChild(cylinderNode24); cylinderMarkerNode124.AddChild(cylinderTransNode24); //add to Card array here: generic trap card here cards[24] = new Card('T', cylinderMarkerNode124, 0, 100, "Miraculous Descent", "Reduce the damage taken to your life points to 0 for the remainder of your opponent's turn."); //Marker 125 cylinderMarkerNode125 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML125.xml", twentyfive); GeometryNode cylinderNode25 = new GeometryNode("Cylinder"); cylinderNode25.Model = trapModel5; ((Model)cylinderNode25.Model).UseInternalMaterials = false; cylinderNode25.Material = sphereMaterial6; TransformNode cylinderTransNode25 = new TransformNode(); cylinderTransNode25.Scale = new Vector3(5, 5, 5); cylinderTransNode25.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode25.AddChild(cylinderNode25); cylinderMarkerNode125.AddChild(cylinderTransNode25); //add to Card array here: generic trap card here cards[25] = new Card('T', cylinderMarkerNode125, 0, 100, "Miraculous Descent", "Reduce the damage taken to your life points to 0 for the remainder of your opponent's turn."); //Marker 126 cylinderMarkerNode126 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML126.xml", twentysix); GeometryNode cylinderNode26 = new GeometryNode("Cylinder"); cylinderNode26.Model = trapModel6; ((Model)cylinderNode26.Model).UseInternalMaterials = false; cylinderNode26.Material = sphereMaterial7; TransformNode cylinderTransNode26 = new TransformNode(); cylinderTransNode26.Scale = new Vector3(5, 5, 5); cylinderTransNode26.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode26.AddChild(cylinderNode26); cylinderMarkerNode126.AddChild(cylinderTransNode26); //add to Card array here: generic trap card here cards[26] = new Card('T', cylinderMarkerNode126, 0, 100, "Solemn Judgment", "Your opponent may not activate spells until the end of their turn."); //Marker 127 cylinderMarkerNode127 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML127.xml", twentyseven); GeometryNode cylinderNode27 = new GeometryNode("Cylinder"); cylinderNode27.Model = trapModel7; ((Model)cylinderNode27.Model).UseInternalMaterials = false; cylinderNode27.Material = sphereMaterial8; TransformNode cylinderTransNode27 = new TransformNode(); cylinderTransNode27.Scale = new Vector3(5, 5, 5); cylinderTransNode27.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode27.AddChild(cylinderNode27); cylinderMarkerNode127.AddChild(cylinderTransNode27); //add to Card array here: generic trap card here cards[27] = new Card('T', cylinderMarkerNode127, 0, 100, "Power Break", "Reduce a monster's attack by 50 for the remainder of your opponent's turn."); //Marker 128 cylinderMarkerNode128 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML128.xml", twentyeight); GeometryNode cylinderNode28 = new GeometryNode("Cylinder"); cylinderNode28.Model = trapModel8; ((Model)cylinderNode28.Model).UseInternalMaterials = false; cylinderNode28.Material = sphereMaterial9; TransformNode cylinderTransNode28 = new TransformNode(); cylinderTransNode28.Scale = new Vector3(5, 5, 5); cylinderTransNode28.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode28.AddChild(cylinderNode28); cylinderMarkerNode128.AddChild(cylinderTransNode28); //add to Card array here: generic trap card here cards[28] = new Card('T', cylinderMarkerNode128, 0, 100, "Reinforcements", "Increase a target monster's attack by 40 for the remainder of your opponent's turn."); //Marker 129 cylinderMarkerNode129 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML129.xml", twentynine); GeometryNode cylinderNode29 = new GeometryNode("Cylinder"); cylinderNode29.Model = trapModel9; ((Model)cylinderNode29.Model).UseInternalMaterials = false; cylinderNode29.Material = sphereMaterial10; TransformNode cylinderTransNode29 = new TransformNode(); cylinderTransNode29.Scale = new Vector3(5, 5, 5); cylinderTransNode29.Rotation = Quaternion.CreateFromYawPitchRoll(0, 1.5f, 0); cylinderTransNode29.AddChild(cylinderNode29); cylinderMarkerNode129.AddChild(cylinderTransNode29); //add to Card array here: generic trap card here cards[29] = new Card('T', cylinderMarkerNode129, 0, 100, "Earthshaker", "For the remainder of your opponent's turn, reduce the attack of a monster to 0."); //Marker 30 = Player 1 Marker cylinderMarkerNode130 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML130.xml", thirty); GeometryNode cylinderNode30 = new GeometryNode("Sphere"); cylinderNode30.Model = new Sphere(5, 20, 20); cylinderNode30.Material = sphereMaterial3; TransformNode cylinderTransNode30 = new TransformNode(); cylinderTransNode30.Translation = new Vector3(0, 0, 3); cylinderTransNode30.AddChild(cylinderNode30); cylinderMarkerNode130.AddChild(cylinderTransNode30); //Marker 31 = Player 2 Marker cylinderMarkerNode131 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML131.xml", thirtyone); GeometryNode cylinderNode31 = new GeometryNode("Sphere"); cylinderNode31.Model = new Sphere(5, 20, 20); cylinderNode31.Material = sphereMaterial; TransformNode cylinderTransNode31 = new TransformNode(); cylinderTransNode31.Translation = new Vector3(0, 0, 3); cylinderTransNode31.AddChild(cylinderNode31); cylinderMarkerNode131.AddChild(cylinderTransNode31); //Marker 32 = P1 Monster Position Marker 1 cylinderMarkerNode132 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML132.xml", thirtytwo); //Marker 33 = P1 Monster Position Marker 2 cylinderMarkerNode133 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML133.xml", thirtythree); //Marker 34 = P1 Monster Position Marker 3 cylinderMarkerNode134 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML134.xml", thirtyfour); //Marker 35 = P2 Monster Position Marker 1 cylinderMarkerNode135 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML135.xml", thirtyfive); //Marker 36 = P2 Monster Position Marker 2 cylinderMarkerNode136 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML136.xml", thirtysix); //Marker 37 = P2 Monster Position Marker 3 cylinderMarkerNode137 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML137.xml", thirtyseven); //Marker 38 = P1 Spell Position Marker cylinderMarkerNode138 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML138.xml", thirtyeight); //Marker 39 = P2 Spell Position Marker cylinderMarkerNode139 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML139.xml", thirtynine); //Marker 40 = P1 Trap Position Marker cylinderMarkerNode140 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML140.xml", forty); //Marker 41 = P2 Trap Position Marker cylinderMarkerNode141 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML141.xml", fortyone); scene.RootNode.AddChild(cylinderMarkerNode100); scene.RootNode.AddChild(cylinderMarkerNode101); scene.RootNode.AddChild(cylinderMarkerNode102); scene.RootNode.AddChild(cylinderMarkerNode103); scene.RootNode.AddChild(cylinderMarkerNode104); scene.RootNode.AddChild(cylinderMarkerNode105); scene.RootNode.AddChild(cylinderMarkerNode106); scene.RootNode.AddChild(cylinderMarkerNode107); scene.RootNode.AddChild(cylinderMarkerNode108); scene.RootNode.AddChild(cylinderMarkerNode109); scene.RootNode.AddChild(cylinderMarkerNode110); scene.RootNode.AddChild(cylinderMarkerNode111); scene.RootNode.AddChild(cylinderMarkerNode112); scene.RootNode.AddChild(cylinderMarkerNode113); scene.RootNode.AddChild(cylinderMarkerNode114); scene.RootNode.AddChild(cylinderMarkerNode115); scene.RootNode.AddChild(cylinderMarkerNode116); scene.RootNode.AddChild(cylinderMarkerNode117); scene.RootNode.AddChild(cylinderMarkerNode118); scene.RootNode.AddChild(cylinderMarkerNode119); scene.RootNode.AddChild(cylinderMarkerNode120); scene.RootNode.AddChild(cylinderMarkerNode121); scene.RootNode.AddChild(cylinderMarkerNode122); scene.RootNode.AddChild(cylinderMarkerNode123); scene.RootNode.AddChild(cylinderMarkerNode124); scene.RootNode.AddChild(cylinderMarkerNode125); scene.RootNode.AddChild(cylinderMarkerNode126); scene.RootNode.AddChild(cylinderMarkerNode127); scene.RootNode.AddChild(cylinderMarkerNode128); scene.RootNode.AddChild(cylinderMarkerNode129); scene.RootNode.AddChild(cylinderMarkerNode130); scene.RootNode.AddChild(cylinderMarkerNode131); scene.RootNode.AddChild(cylinderMarkerNode132); scene.RootNode.AddChild(cylinderMarkerNode133); scene.RootNode.AddChild(cylinderMarkerNode134); scene.RootNode.AddChild(cylinderMarkerNode135); scene.RootNode.AddChild(cylinderMarkerNode136); scene.RootNode.AddChild(cylinderMarkerNode137); scene.RootNode.AddChild(cylinderMarkerNode138); scene.RootNode.AddChild(cylinderMarkerNode139); scene.RootNode.AddChild(cylinderMarkerNode140); scene.RootNode.AddChild(cylinderMarkerNode141); }
private void CreateObjects() { // Create a marker node to track a ground marker array. #if USE_PATTERN_MARKER if(useSingleMarker) groundMarkerNode = new MarkerNode(scene.MarkerTracker, "patt.hiro", 16, 16, markerSize, 0.7f); else groundMarkerNode = new MarkerNode(scene.MarkerTracker, "NyARToolkitGroundArray.xml", NyARToolkitTracker.ComputationMethod.Average); #else groundMarkerNode = new MarkerNode(scene.MarkerTracker, "NyARIdGroundArray.xml", NyARToolkitTracker.ComputationMethod.Average); #endif scene.RootNode.AddChild(groundMarkerNode); // Create a geometry node with a model of a box that will be overlaid on // top of the ground marker array initially. (When the toolbar marker array is // detected, it will be overlaid on top of the toolbar marker array.) GeometryNode boxNode = new GeometryNode("Box"); boxNode.Model = new Box(markerSize); // Create a material to apply to the box model Material boxMaterial = new Material(); boxMaterial.Diffuse = new Vector4(0.5f, 0, 0, 1); boxMaterial.Specular = Color.White.ToVector4(); boxMaterial.SpecularPower = 10; boxNode.Material = boxMaterial; TransformNode boxTransNode = new TransformNode(); boxTransNode.Translation = new Vector3(0, 0, markerSize / 2); // Add this box model node to the ground marker node groundMarkerNode.AddChild(boxTransNode); boxTransNode.AddChild(boxNode); }
private void CreateObjects() { allShapesNode = new GeometryNode(); allShapesMat = new Material(); allShapesTransNode = new TransformNode(); // Create a geometry node with a model of a sphere that will be overlaid on // top of the ground marker array sphereNode = new GeometryNode("Sphere"); sphereNode.Model = new Sphere(3, 20, 20); // Add this sphere model to the physics engine for collision detection sphereNode.AddToPhysicsEngine = true; sphereNode.Physics.Shape = ShapeType.Sphere; // Make this sphere model cast and receive shadows sphereNode.Model.CastShadows = true; sphereNode.Model.ReceiveShadows = true; // Create a marker node to track a ground marker array. groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARGroundArray.xml"); // Since the ground marker's size is 80x52 ARTag units, in order to move the sphere model // to the center of the ground marker, we shift it by 40x26 units and also make it // float from the ground marker's center TransformNode sphereTransNode = new TransformNode(); sphereTransNode.Translation = new Vector3(40, 26, 10); // Create a material to apply to the sphere model Material sphereMaterial = new Material(); sphereMaterial.Diffuse = new Vector4(0, 0.5f, 0, 1); sphereMaterial.Specular = Color.White.ToVector4(); sphereMaterial.SpecularPower = 10; sphereNode.Material = sphereMaterial; // Now add the above nodes to the scene graph in the appropriate order. // Note that only the nodes added below the marker node are affected by // the marker transformation. scene.RootNode.AddChild(groundMarkerNode); groundMarkerNode.AddChild(sphereTransNode); sphereTransNode.AddChild(sphereNode); // Create a geometry node with a model of a box that will be overlaid on // top of the ground marker array initially. (When the toolbar marker array is // detected, it will be overlaid on top of the toolbar marker array.) boxNode = new GeometryNode("Box"); boxNode.Model = new Box(8); // Add this box model to the physics engine for collision detection boxNode.AddToPhysicsEngine = true; boxNode.Physics.Shape = ShapeType.Box; // Make this box model cast and receive shadows boxNode.Model.CastShadows = true; boxNode.Model.ReceiveShadows = true; // Create a marker node to track a toolbar marker array. toolbarMarkerNode = new MarkerNode(scene.MarkerTracker, "Toolbar.txt"); scene.RootNode.AddChild(toolbarMarkerNode); // Create a material to apply to the box model Material boxMaterial = new Material(); boxMaterial.Diffuse = new Vector4(0.5f, 0, 0, 1); boxMaterial.Specular = Color.White.ToVector4(); boxMaterial.SpecularPower = 10; boxNode.Material = boxMaterial; // Add this box model node to the ground marker node groundMarkerNode.AddChild(boxNode); // Create a collision pair and add a collision callback function that will be // called when the pair collides NewtonPhysics.CollisionPair pair = new NewtonPhysics.CollisionPair(boxNode.Physics, sphereNode.Physics); ((NewtonPhysics)scene.PhysicsEngine).AddCollisionCallback(pair, BoxSphereCollision); //NewtonPhysics.CollisionPair tmp = new NewtonPhysics.CollisionPair // NewtonMaterial.ContactBegin startWar = new NewtonMaterial.ContactBegin(boxNode.Physics, sphereNode.Physics); ids1 = new int[4]; ids1[0] = 70; ids1[1] = 71; ids1[2] = 72; ids1[3] = 73; MarkerNode1 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML1.xml", ids1); cylinderNode1 = new GeometryNode("ENEMY's SHIP"); cylinderNode1.Model = new Cylinder(3, 3, 6, 10); cylinderNode1.Material = sphereMaterial; TransformNode cylinderTransNode = new TransformNode(); cylinderTransNode.Translation = new Vector3(0, 0, 3); MarkerNode1.AddChild(cylinderTransNode); cylinderTransNode.AddChild(cylinderNode1); scene.RootNode.AddChild(MarkerNode1); ids2 = new int[4]; ids2[0] = 80; ids2[1] = 81; ids2[2] = 82; ids2[3] = 83; MarkerNode2 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML2.xml", ids2); cylinderNode2 = new GeometryNode("PLAYER's SHIP EAST"); cylinderNode2.Model = new Cylinder(3, 3, 6, 10); cylinderNode2.Material = boxMaterial; TransformNode cylinderTransNode2 = new TransformNode(); cylinderTransNode2.Translation = new Vector3(20, 5, 10); MarkerNode2.AddChild(cylinderTransNode2); cylinderTransNode2.AddChild(cylinderNode2); scene.RootNode.AddChild(MarkerNode2); ids3 = new int[4]; ids3[0] = 90; ids3[1] = 91; ids3[2] = 92; ids3[3] = 93; MarkerNode3 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML3.xml", ids3); cylinderNode3 = new GeometryNode("PLAYER's SHIP WEST"); cylinderNode3.Model = new Cylinder(3, 3, 6, 10); cylinderNode3.Material = sphereMaterial; TransformNode cylinderTransNode3 = new TransformNode(); cylinderTransNode3.Translation = new Vector3(0, 5, 0); MarkerNode3.AddChild(cylinderTransNode3); cylinderTransNode3.AddChild(cylinderNode3); scene.RootNode.AddChild(MarkerNode3); ids4 = new int[4]; ids4[0] = 100; ids4[1] = 101; ids4[2] = 102; ids4[3] = 103; MarkerNode4 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML4.xml", ids4); cylinderNode4 = new GeometryNode("PLAYER's NORTH"); cylinderNode4.Model = new Cylinder(3, 3, 6, 10); cylinderNode4.Material = boxMaterial; TransformNode cylinderTransNode4 = new TransformNode(); cylinderTransNode4.Translation = new Vector3(0, 0, 0); MarkerNode4.AddChild(cylinderTransNode4); cylinderTransNode4.AddChild(cylinderNode4); scene.RootNode.AddChild(MarkerNode4); ids5 = new int[4]; ids5[0] = 110; ids5[1] = 111; ids5[2] = 112; ids5[3] = 113; MarkerNode5 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML5.xml", ids5); ids6 = new int[4]; ids6[0] = 120; ids6[1] = 121; ids6[2] = 122; ids6[3] = 123; MarkerNode6 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML6.xml", ids6); ids7 = new int[4]; ids7[0] = 130; ids7[1] = 131; ids7[2] = 132; ids7[3] = 133; MarkerNode7 = new MarkerNode(scene.MarkerTracker, "ALVARConfigFromXML7.xml", ids7); scene.RootNode.AddChild(MarkerNode5); scene.RootNode.AddChild(MarkerNode6); scene.RootNode.AddChild(MarkerNode7); }
public void CreateObjects() { floor = new GeometryNode("Floor");//floor floor.Model = new Box(floorBreadth, floorLength, 0.0001f); floor.Model.ReceiveShadows = true; floorTransNode = new TransformNode(); floorTransNode.Translation = new Vector3(floorBreadth / 3, -floorLength / 2, 0); // 0 0 floor.Physics.Collidable = true; floor.Physics.Pickable = true; floor.GroupID = roomGroupID; floor.Physics.Shape = GoblinXNA.Physics.ShapeType.Box; floor.AddToPhysicsEngine = true; //grid1.IsOccluder = true; //Material for the room floor floorMaterial = new Material(); Vector4 alpha = Color.Gray.ToVector4(); Vector3 tempAlpha = new Vector3(alpha.X, alpha.Y, alpha.Z); floorMaterial.Diffuse = new Vector4(tempAlpha, 0.2f); floorMaterial.Specular = Color.White.ToVector4(); floorMaterial.SpecularPower = 20; floor.Material = floorMaterial; //Material for the walls wallsMaterial = new Material(); wallsMaterial.Diffuse = Color.Gray.ToVector4(); wallsMaterial.Specular = Color.White.ToVector4(); wallsMaterial.SpecularPower = 20; frontWall = new GeometryNode("Front wall");//front wall frontWall.Model = new Box(floorBreadth, floorLength, 1); frontWallTransNode = new TransformNode(); frontWallTransNode.Translation = new Vector3(floorBreadth / 3, 0, floorLength/2); // 1 0 frontWallTransNode.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitX, MathHelper.ToRadians(90)); frontWall.Material = wallsMaterial; frontWall.GroupID = roomGroupID; frontWall.AddToPhysicsEngine = true; frontWall.Physics.Collidable = true; frontWall.Physics.Pickable = true; frontWall.Physics.Shape = GoblinXNA.Physics.ShapeType.Box; rightWall = new GeometryNode("Right wall");//right side wall rightWall.Model = new Box(floorBreadth, floorLength, 1); rightWallTransNode = new TransformNode(); rightWallTransNode.Translation = new Vector3(floorBreadth*4.2f/5, -floorLength / 2, floorLength / 2); // -1 0 rightWallTransNode.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, MathHelper.ToRadians(90)); rightWall.Material = wallsMaterial; rightWall.AddToPhysicsEngine = true; rightWall.GroupID = roomGroupID; rightWall.Physics.Pickable = true; rightWall.Physics.Collidable = true; rightWall.Physics.Shape = GoblinXNA.Physics.ShapeType.Box; // Create a marker node to track a ground marker array. #if USE_ARTAG groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ground"); // Since we expect that the ground marker array won't move very much, we use a // small smoothing alpha. //groundMarkerNode.Smoother = new DESSmoother(0.2f, 0.1f, 1, 1); #else // groundMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARGroundArray.xml"); groundMarkerNode = new MarkerNode(this.scene.MarkerTracker, "ALVARConfig.txt"); #endif // Now add the above nodes to the scene graph in the appropriate order. // Note that only the nodes added below the marker node are affected by // the marker transformation. scene.RootNode.AddChild(groundMarkerNode); //Change the toolbar.txt config file. As of now, toolbar has markers included in the long stretch-alvarConfig.txt worldInMiniatureMarkerNode = new MarkerNode(scene.MarkerTracker, "ALVARConfig32_33.txt"); scene.RootNode.AddChild(worldInMiniatureMarkerNode); groundMarkerNode.AddChild(floorTransNode); floorTransNode.AddChild(floor); groundMarkerNode.AddChild(frontWallTransNode); frontWallTransNode.AddChild(frontWall); groundMarkerNode.AddChild(rightWallTransNode); rightWallTransNode.AddChild(rightWall); }