void CreateMesh() { //Assign random values to the height, depth, and rims of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.classicModel.Windscreen.Height.x, dc.classicModel.Windscreen.Height.y); depth = Random.Range(dc.classicModel.Windscreen.Depth.x, dc.classicModel.Windscreen.Depth.y); rim = Random.Range(dc.classicModel.Windscreen.Rim.x, dc.classicModel.Windscreen.Rim.y); offset = Random.Range(dc.classicModel.Windscreen.TopOffset.x, dc.classicModel.Windscreen.TopOffset.y); //height = Random.Range (2.0f, 2.75f); //depth = Random.Range (0.5f, 3.5f); //rim = Random.Range (0.1f, 0.2f); //offset = Random.Range (0f, 0.5f); Vector3 previous2 = bonnetPartB.mesh.vertices [2]; Vector3 previous3 = bonnetPartB.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x + rim, previous2.y + rim, previous2.z + (rim / 2)), new Vector3(previous3.x - rim, previous2.y + rim, previous2.z + (rim / 2)), new Vector3(previous3.x - offset, previous3.y + (height + rim), previous3.z + depth), new Vector3((previous3.x - rim) - offset, previous3.y + height, previous3.z + (depth - rim)), new Vector3(previous2.x + offset, previous2.y + (height + rim), previous2.z + depth), new Vector3((previous2.x + rim) + offset, previous2.y + height, previous2.z + (depth - rim)) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1, 1, 3, 4, 4, 3, 5, 4, 5, 6, 6, 5, 7, 6, 7, 0, 7, 2, 0 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); depth = Random.Range(dc.vanModel.Bonnet.Depth.x, dc.vanModel.Bonnet.Depth.y); //depth = Random.Range (1.9f, 2.8f); Vector3 previous2 = grillSlant.mesh.vertices [2]; Vector3 previous3 = grillSlant.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y, previous2.z + depth), new Vector3(previous3.x, previous3.y, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the width, height of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); width = Random.Range(dc.classicModel.Width.x, dc.classicModel.Width.y); height = Random.Range(dc.classicModel.FrontBumper.Height.x, dc.classicModel.FrontBumper.Height.y); //width = Random.Range (5.75f, 8.25f); //height = Random.Range (0.07f, 0.78f); //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(width, 0, 0), new Vector3(0, height, 0), new Vector3(width, height, 0) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Find the data collator class and get the data from it RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.basicModel.RearPanel.Height.x, dc.basicModel.RearPanel.Height.y); depth = Random.Range(dc.basicModel.RearPanel.Depth.x, dc.basicModel.RearPanel.Depth.y); Vector3 bonnet2 = bonnetScript.mesh.vertices [2]; Vector3 bonnet3 = bonnetScript.mesh.vertices [3]; Vector3 previous0 = rearWindowScript.mesh.vertices [0]; Vector3 previous1 = rearWindowScript.mesh.vertices [1]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous0.x, previous0.y, previous0.z), new Vector3(previous1.x, previous1.y, previous1.z), new Vector3(previous0.x, bonnet2.y - height, previous0.z + depth), new Vector3(previous1.x, bonnet3.y - height, previous1.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.classicModel.BonnetPartA.Height.x, dc.classicModel.BonnetPartA.Height.y); depth = Random.Range(dc.classicModel.BonnetPartA.Depth.x, dc.classicModel.BonnetPartA.Depth.y); //height = Random.Range (-0.3f, 0.3f); //depth = Random.Range (1.87f, 2.78f); Vector3 previous2 = upwardFrontBumper.mesh.vertices [2]; Vector3 previous3 = upwardFrontBumper.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y + height, previous2.z + depth), new Vector3(previous3.x, previous3.y + height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.vanModel.BumperStraight.Height.x, dc.vanModel.BumperStraight.Height.y); //height = Random.Range(0.37f, 0.85f); Vector3 previous2 = bumperUnderside.mesh.vertices [2]; Vector3 previous3 = bumperUnderside.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y + height, previous2.z), new Vector3(previous3.x, previous3.y + height, previous3.z) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Find the data collator class and get the data from it RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.basicModel.Windscreen.Height.x, dc.basicModel.Windscreen.Height.y); depth = Random.Range(dc.basicModel.Windscreen.Depth.x, dc.basicModel.Windscreen.Depth.y); rim = Random.Range(dc.basicModel.Windscreen.Rim.x, dc.basicModel.Windscreen.Rim.y); Vector3 previous2 = bonnetToWindscreenScript.mesh.vertices [2]; Vector3 previous3 = bonnetToWindscreenScript.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x + rim, previous2.y + rim, previous2.z + (rim / 2)), new Vector3(previous3.x - rim, previous2.y + rim, previous2.z + (rim / 2)), new Vector3(previous3.x, previous3.y + (height + rim), previous3.z + depth), new Vector3(previous3.x - rim, previous3.y + height, previous3.z + (depth - rim)), new Vector3(previous2.x, previous2.y + (height + rim), previous2.z + depth), new Vector3(previous2.x + rim, previous2.y + height, previous2.z + (depth - rim)) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1, 1, 3, 4, 4, 3, 5, 4, 5, 6, 6, 5, 7, 6, 7, 0, 7, 2, 0 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); depth = Random.Range(dc.vanModel.RearBumper.Depth.x, dc.vanModel.RearBumper.Depth.y); height = FindObjectOfType <Van1BumperUnderside> ().mesh.vertices[2].y; //depth = Random.Range (0.1f, 0.2f); Vector3 previous2 = rearEnd.mesh.vertices [2]; Vector3 previous3 = rearEnd.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, height, previous2.z + depth), new Vector3(previous3.x, height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); depth = Random.Range(dc.vanModel.Roof.Depth.x, dc.vanModel.Roof.Depth.y); //depth = Random.Range (8.3f, 10.8f); Vector3 previous2 = windscreen.mesh.vertices [6]; Vector3 previous3 = windscreen.mesh.vertices [4]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y, previous2.z + depth), new Vector3(previous3.x, previous3.y, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); depth = Random.Range(dc.classicModel.RearTop.Depth.x, dc.classicModel.RearTop.Depth.y); height = frontBumper.mesh.vertices[3].y; //depth = Random.Range (0.50f, 1.75f); Vector3 previous2 = rearBody.mesh.vertices [2]; Vector3 previous3 = rearBody.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, height, previous2.z + depth), new Vector3(previous3.x, height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the width, height of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); width = Random.Range(dc.vanModel.Width.x, dc.vanModel.Width.y); height = Random.Range(dc.vanModel.BumperUnderside.Height.x, dc.vanModel.BumperUnderside.Height.y); depth = Random.Range(dc.vanModel.BumperUnderside.Depth.x, dc.vanModel.BumperUnderside.Depth.y); //width = Random.Range (5.75f, 8.25f); //height = Random.Range (0.3f, 0.4f); //depth = Random.Range (-0.7f, -0.1f); //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(width, 0, 0), new Vector3(0, height, depth), new Vector3(width, height, depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); depth = Random.Range(dc.classicModel.RearBody.Depth.x, dc.classicModel.RearBody.Depth.y); gap = Random.Range(dc.classicModel.RearBody.Gap.x, dc.classicModel.RearBody.Gap.y); //depth = Random.Range (1.75f, 4.25f); //gap = Random.Range(2.5f, 6.75f); Vector3 previous2 = windscreen.mesh.vertices [0]; Vector3 previous3 = windscreen.mesh.vertices [1]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z + gap), new Vector3(previous3.x, previous3.y, previous3.z + gap), new Vector3(previous2.x, previous2.y, previous2.z + gap + depth), new Vector3(previous3.x, previous3.y, previous3.z + gap + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.vanModel.RearSlant.Height.x, dc.vanModel.RearSlant.Height.y); depth = Random.Range(dc.vanModel.RearSlant.Depth.x, dc.vanModel.RearSlant.Depth.y); //height = Random.Range (-0.7f, -0.3f); //depth = Random.Range (0.1f, 0.3f); Vector3 previous2 = roof.mesh.vertices [2]; Vector3 previous3 = roof.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y + height, previous2.z + depth), new Vector3(previous3.x, previous3.y + height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Find the data collator class and get the data from it RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.basicModel.Backend.Height.x, dc.basicModel.Backend.Height.y); depth = Random.Range(dc.basicModel.Backend.Depth.x, dc.basicModel.Backend.Depth.y); Vector3 grill0 = grillScript.mesh.vertices [0]; Vector3 grill1 = grillScript.mesh.vertices [1]; Vector3 previous2 = rearWindowScript.mesh.vertices [2]; Vector3 previous3 = rearWindowScript.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, grill0.y + height, previous2.z + depth), new Vector3(previous3.x, grill1.y + height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Assign random values to the depth of the mesh RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.classicModel.UpwardFrontBumper.Height.x, dc.classicModel.UpwardFrontBumper.Height.y); //height = Random.Range (0.47f, 1.56f); //depth = Random.Range (0.4f, 0.9f); Vector3 previous2 = inwardFrontBumper.mesh.vertices [2]; Vector3 previous3 = inwardFrontBumper.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y + height, previous2.z), new Vector3(previous3.x, previous3.y + height, previous3.z) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Find the data collator class and get the data from it RandomControl dc = FindObjectOfType <RandomControl> (); width = Random.Range(dc.basicModel.Width.x, dc.basicModel.Width.y); height = Random.Range(dc.basicModel.Grill.Height.x, dc.basicModel.Grill.Height.y); depth = Random.Range(dc.basicModel.Grill.Depth.x, dc.basicModel.Grill.Depth.y); //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(0, 0, 0), new Vector3(width, 0, 0), new Vector3(0, height, depth), new Vector3(width, height, depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }
void CreateMesh() { //Find the data collator class and get the data from it RandomControl dc = FindObjectOfType <RandomControl> (); height = Random.Range(dc.basicModel.BonnetToWindscreen.Height.x, dc.basicModel.BonnetToWindscreen.Height.y); depth = Random.Range(dc.basicModel.BonnetToWindscreen.Depth.x, dc.basicModel.BonnetToWindscreen.Depth.y); Vector3 previous2 = bonnetData.mesh.vertices [2]; Vector3 previous3 = bonnetData.mesh.vertices [3]; //Assign the mesh vertices mesh.vertices = new Vector3[] { new Vector3(previous2.x, previous2.y, previous2.z), new Vector3(previous3.x, previous3.y, previous3.z), new Vector3(previous2.x, previous2.y + height, previous2.z + depth), new Vector3(previous3.x, previous3.y + height, previous3.z + depth) }; //Assign the mesh triangles mesh.triangles = new int[] { 0, 2, 1, 2, 3, 1 }; //Calculate the normals of the mesh fom the triangles mesh.RecalculateNormals(); }