private static void AddPoints(Group g, Vector3[] pointCenters, Texture texture, float size) { BufferedIndexedPrimitives <VertexFakePointSprite> indexedPrimitives = new BufferedIndexedPrimitives <VertexFakePointSprite>(PrimitiveType.TriangleList); g.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives; indexedPrimitives.Vertices = new VertexFakePointSprite[pointCenters.Length * 4]; indexedPrimitives.Indices = new int[pointCenters.Length * 6]; Random random = RandomHelper.Random; int length = StarField.Colors.Length; VertexFakePointSprite[] vertices = indexedPrimitives.Vertices; int[] indices = indexedPrimitives.Indices; for (int index1 = 0; index1 < pointCenters.Length; ++index1) { Color color = StarField.Colors[random.Next(0, length)]; int index2 = index1 * 4; vertices[index2] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(0.0f, 0.0f), new Vector2(-size, -size)); vertices[index2 + 1] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(1f, 0.0f), new Vector2(size, -size)); vertices[index2 + 2] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(1f, 1f), new Vector2(size, size)); vertices[index2 + 3] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(0.0f, 1f), new Vector2(-size, size)); int index3 = index1 * 6; indices[index3] = index2; indices[index3 + 1] = index2 + 1; indices[index3 + 2] = index2 + 2; indices[index3 + 3] = index2; indices[index3 + 4] = index2 + 2; indices[index3 + 5] = index2 + 3; } indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); g.Texture = texture; }
private void Reset() { this.FatAxisMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; this.FatAxisMesh.AddColoredBox(new Vector3(1f, 1f, 10000f) / 200f, new Vector3(-0.5f, -0.5f, 0.0f) / 200f, Color.Blue, false); this.FatAxisMesh.Rotation = new Quaternion(-0.7408407f, -0.4897192f, 0.4504161f, 0.09191696f); this.FatAxisMesh.Scale = new Vector3(3f); this.FatAxisMesh.Position = new Vector3(7.574002f, 3.049632f, 5.773395f); if (this.HelixMesh != null && this.HelixMesh.Groups.Count == 1) { (this.HelixMesh.FirstGroup.Geometry as BufferedIndexedPrimitives <FezVertexPositionColor>).Dispose(); } this.HelixMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; for (int index = 0; index < 750; ++index) { float angle = (float)index / 1f; Group group = this.HelixMesh.AddColoredBox(new Vector3(0.2f, 70f, 0.2f) / 10000f, Vector3.Zero, EndCutscene32Host.PurpleBlack, true); group.Position = new Vector3(0.0f, 0.0f, (float)(((double)index - 375.0) / 3000.0)); group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, angle); } this.HelixMesh.CollapseToBuffer <FezVertexPositionColor>(); this.HelixMesh.Rotation = this.FatAxisMesh.Rotation; this.HelixMesh.Scale = this.FatAxisMesh.Scale; this.HelixMesh.Culling = CullMode.None; Random random = RandomHelper.Random; FezVertexPositionColor[] vertices = new FezVertexPositionColor[200000]; int[] indices = new int[200000]; for (int index = 0; index < 100000; ++index) { vertices[index * 2] = new FezVertexPositionColor(new Vector3((float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f, 0.0f), new Color((int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256), 0)); vertices[index * 2 + 1] = new FezVertexPositionColor(vertices[index * 2].Position, new Color((int)vertices[index * 2].Color.R, (int)vertices[index * 2].Color.G, (int)vertices[index * 2].Color.B, (int)byte.MaxValue)); indices[index * 2] = index * 2; indices[index * 2 + 1] = index * 2 + 1; } this.NoiseMesh = new Mesh() { Effect = (BaseEffect)(this.ShimmeringEffect = new ShimmeringPointsEffect()) }; Group group1 = this.NoiseMesh.AddGroup(); BufferedIndexedPrimitives <FezVertexPositionColor> indexedPrimitives = new BufferedIndexedPrimitives <FezVertexPositionColor>(vertices, indices, PrimitiveType.LineList); indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); group1.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives; this.NoiseMesh.Effect.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1f, 1f, 0.1f, 100f)); this.NoiseMesh.Effect.ForcedViewMatrix = new Matrix?(Matrix.CreateLookAt(-Vector3.UnitZ, Vector3.Zero, Vector3.Up)); this.PurpleGradientTexture = this.CMProvider.Global.Load <Texture2D>("Other Textures/end_cutscene/purple_gradient"); }
public override void Initialize() { base.Initialize(); this.sBlueZoomOut = this.CMProvider.Get(CM.EndCutscene).Load <SoundEffect>("Sounds/Ending/Cutscene64/BlueZoomOut"); this.sProgressiveAppear = this.CMProvider.Get(CM.EndCutscene).Load <SoundEffect>("Sounds/Ending/Cutscene64/CubesProgressiveAppear"); this.sFadeOut = this.CMProvider.Get(CM.EndCutscene).Load <SoundEffect>("Sounds/Ending/Cutscene64/CubesFadeOut"); this.LevelManager.ActualAmbient = new Color(0.25f, 0.25f, 0.25f); this.LevelManager.ActualDiffuse = Color.White; Random random = RandomHelper.Random; float y1 = 1f / (float)Math.Sqrt(6.0); float z1 = (float)Math.Sqrt(3.0) / 2f; float y2 = (float)Math.Sqrt(2.0 / 3.0); float z2 = (float)(1.0 / (2.0 * Math.Sqrt(3.0))); float x = 1f / (float)Math.Sqrt(2.0); VertexPositionNormalColor[] vertices = new VertexPositionNormalColor[864000]; int[] indices = new int[1296000]; int num1 = 0; int num2 = 0; for (int index1 = -100; index1 < 100; ++index1) { for (int index2 = -180; index2 < 180; ++index2) { Color color = index2 != 0 || index1 != 0 ? MulticoloredSpace.Colors[random.Next(0, MulticoloredSpace.Colors.Length)] : MulticoloredSpace.MainCubeColor; Vector3 vector3 = new Vector3((float)(index2 * 6), (float)(index1 * 6 + (Math.Abs(index2) % 2 == 0 ? 0 : 3)), 0.0f); int num3 = num1; VertexPositionNormalColor[] positionNormalColorArray1 = vertices; int index3 = num1; int num4 = 1; int num5 = index3 + num4; positionNormalColorArray1[index3] = new VertexPositionNormalColor(new Vector3(x, -y1, -z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray2 = vertices; int index4 = num5; int num6 = 1; int num7 = index4 + num6; positionNormalColorArray2[index4] = new VertexPositionNormalColor(new Vector3(x, y1, z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray3 = vertices; int index5 = num7; int num8 = 1; int num9 = index5 + num8; positionNormalColorArray3[index5] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray4 = vertices; int index6 = num9; int num10 = 1; int num11 = index6 + num10; positionNormalColorArray4[index6] = new VertexPositionNormalColor(new Vector3(0.0f, -y2, z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray5 = vertices; int index7 = num11; int num12 = 1; int num13 = index7 + num12; positionNormalColorArray5[index7] = new VertexPositionNormalColor(new Vector3(0.0f, -y2, z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray6 = vertices; int index8 = num13; int num14 = 1; int num15 = index8 + num14; positionNormalColorArray6[index8] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray7 = vertices; int index9 = num15; int num16 = 1; int num17 = index9 + num16; positionNormalColorArray7[index9] = new VertexPositionNormalColor(new Vector3(-x, y1, z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray8 = vertices; int index10 = num17; int num18 = 1; int num19 = index10 + num18; positionNormalColorArray8[index10] = new VertexPositionNormalColor(new Vector3(-x, -y1, -z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray9 = vertices; int index11 = num19; int num20 = 1; int num21 = index11 + num20; positionNormalColorArray9[index11] = new VertexPositionNormalColor(new Vector3(0.0f, y2, -z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray10 = vertices; int index12 = num21; int num22 = 1; int num23 = index12 + num22; positionNormalColorArray10[index12] = new VertexPositionNormalColor(new Vector3(-x, y1, z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray11 = vertices; int index13 = num23; int num24 = 1; int num25 = index13 + num24; positionNormalColorArray11[index13] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray12 = vertices; int index14 = num25; int num26 = 1; num1 = index14 + num26; positionNormalColorArray12[index14] = new VertexPositionNormalColor(new Vector3(x, y1, z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); int[] numArray1 = indices; int index15 = num2; int num27 = 1; int num28 = index15 + num27; int num29 = num3; numArray1[index15] = num29; int[] numArray2 = indices; int index16 = num28; int num30 = 1; int num31 = index16 + num30; int num32 = 2 + num3; numArray2[index16] = num32; int[] numArray3 = indices; int index17 = num31; int num33 = 1; int num34 = index17 + num33; int num35 = 1 + num3; numArray3[index17] = num35; int[] numArray4 = indices; int index18 = num34; int num36 = 1; int num37 = index18 + num36; int num38 = num3; numArray4[index18] = num38; int[] numArray5 = indices; int index19 = num37; int num39 = 1; int num40 = index19 + num39; int num41 = 3 + num3; numArray5[index19] = num41; int[] numArray6 = indices; int index20 = num40; int num42 = 1; int num43 = index20 + num42; int num44 = 2 + num3; numArray6[index20] = num44; int[] numArray7 = indices; int index21 = num43; int num45 = 1; int num46 = index21 + num45; int num47 = 4 + num3; numArray7[index21] = num47; int[] numArray8 = indices; int index22 = num46; int num48 = 1; int num49 = index22 + num48; int num50 = 6 + num3; numArray8[index22] = num50; int[] numArray9 = indices; int index23 = num49; int num51 = 1; int num52 = index23 + num51; int num53 = 5 + num3; numArray9[index23] = num53; int[] numArray10 = indices; int index24 = num52; int num54 = 1; int num55 = index24 + num54; int num56 = 4 + num3; numArray10[index24] = num56; int[] numArray11 = indices; int index25 = num55; int num57 = 1; int num58 = index25 + num57; int num59 = 7 + num3; numArray11[index25] = num59; int[] numArray12 = indices; int index26 = num58; int num60 = 1; int num61 = index26 + num60; int num62 = 6 + num3; numArray12[index26] = num62; int[] numArray13 = indices; int index27 = num61; int num63 = 1; int num64 = index27 + num63; int num65 = 8 + num3; numArray13[index27] = num65; int[] numArray14 = indices; int index28 = num64; int num66 = 1; int num67 = index28 + num66; int num68 = 10 + num3; numArray14[index28] = num68; int[] numArray15 = indices; int index29 = num67; int num69 = 1; int num70 = index29 + num69; int num71 = 9 + num3; numArray15[index29] = num71; int[] numArray16 = indices; int index30 = num70; int num72 = 1; int num73 = index30 + num72; int num74 = 8 + num3; numArray16[index30] = num74; int[] numArray17 = indices; int index31 = num73; int num75 = 1; int num76 = index31 + num75; int num77 = 11 + num3; numArray17[index31] = num77; int[] numArray18 = indices; int index32 = num76; int num78 = 1; num2 = index32 + num78; int num79 = 10 + num3; numArray18[index32] = num79; } } this.CubesMesh = new Mesh() { Effect = (BaseEffect)(this.CubesEffect = (DefaultEffect) new DefaultEffect.LitVertexColored()), DepthWrites = false, AlwaysOnTop = true }; Group group = this.CubesMesh.AddGroup(); BufferedIndexedPrimitives <VertexPositionNormalColor> indexedPrimitives = new BufferedIndexedPrimitives <VertexPositionNormalColor>(vertices, indices, PrimitiveType.TriangleList); indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); group.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives; this.PointsMesh = new Mesh() { Effect = (BaseEffect) new PointsFromLinesEffect(), DepthWrites = false, AlwaysOnTop = true }; Color[] colorArray = new Color[32640]; Vector3[] vector3Array = new Vector3[32640]; int index33 = 0; for (int index1 = -68; index1 < 68; ++index1) { for (int index2 = -120; index2 < 120; ++index2) { vector3Array[index33] = new Vector3((float)index2 / 8f, (float)((double)index1 / 8.0 + (Math.Abs(index2) % 2 == 0 ? 0.0 : 1.0 / 16.0)), 0.0f); colorArray[index33++] = RandomHelper.InList <Color>(MulticoloredSpace.Colors); } } this.PointsMesh.AddPoints((IList <Color>)colorArray, (IEnumerable <Vector3>)vector3Array, true); }
public override void Initialize() { base.Initialize(); this.LinesMesh = new Mesh() { Effect = (BaseEffect) (this.StaticEffect = new VibratingEffect()) }; FezVertexPositionColor[] vertices1 = new FezVertexPositionColor[5120]; int[] indices1 = new int[5120]; for (int index1 = 0; index1 < 1280; ++index1) { int index2 = 2 * index1; indices1[index2] = index2; vertices1[index2] = new FezVertexPositionColor(new Vector3(-640f, 0.0f, (float) (index1 - 640)), Color.White); int index3 = index2 + 1; indices1[index3] = index3; vertices1[index3] = new FezVertexPositionColor(new Vector3(640f, 0.0f, (float) (index1 - 640)), Color.White); int index4 = index3 + 2559; indices1[index4] = index4; vertices1[index4] = new FezVertexPositionColor(new Vector3((float) (index1 - 640), 0.0f, -640f), Color.White); int index5 = index4 + 1; indices1[index5] = index5; vertices1[index5] = new FezVertexPositionColor(new Vector3((float) (index1 - 640), 0.0f, 640f), Color.White); } Group group1 = this.LinesMesh.AddGroup(); BufferedIndexedPrimitives<FezVertexPositionColor> indexedPrimitives1 = new BufferedIndexedPrimitives<FezVertexPositionColor>(vertices1, indices1, PrimitiveType.LineList); indexedPrimitives1.UpdateBuffers(); indexedPrimitives1.CleanUp(); group1.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives1; Random random = RandomHelper.Random; this.VibratingMesh = new Mesh() { Effect = (BaseEffect) (this.VibratingEffect = new VibratingEffect()) }; FezVertexPositionColor[] vertices2 = new FezVertexPositionColor[500000]; int[] indices2 = new int[998000]; int num1 = 0; int num2 = 0; for (int index1 = 0; index1 < 500; ++index1) { int[] numArray1 = indices2; int index2 = num2; int num3 = 1; int num4 = index2 + num3; int num5 = num1; numArray1[index2] = num5; for (int index3 = 0; index3 < 500; ++index3) { if (index3 != 0) indices2[num4++] = num1; vertices2[num1++] = new FezVertexPositionColor(new Vector3((float) (index1 - 250), 0.0f, (float) (index3 - 250)), new Color((int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256))); if (index3 < 498) indices2[num4++] = num1; } int[] numArray2 = indices2; int index4 = num4; int num6 = 1; num2 = index4 + num6; int num7 = num1; numArray2[index4] = num7; for (int index3 = 0; index3 < 500; ++index3) { if (index3 != 0) indices2[num2++] = num1; vertices2[num1++] = new FezVertexPositionColor(new Vector3((float) (index3 - 250), 0.0f, (float) (index1 - 250)), new Color((int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256))); if (index3 < 498) indices2[num2++] = num1; } } Group group2 = this.VibratingMesh.AddGroup(); BufferedIndexedPrimitives<FezVertexPositionColor> indexedPrimitives2 = new BufferedIndexedPrimitives<FezVertexPositionColor>(vertices2, indices2, PrimitiveType.LineList); indexedPrimitives2.UpdateBuffers(); indexedPrimitives2.CleanUp(); group2.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives2; this.CubeMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; this.CubeMesh.AddColoredBox(Vector3.One, Vector3.One, Color.White, true); FezVertexPositionColor[] vertices3 = new FezVertexPositionColor[200000]; int[] indices3 = new int[200000]; for (int index = 0; index < 100000; ++index) { vertices3[index * 2] = new FezVertexPositionColor(new Vector3((float) (random.NextDouble() * 2.0 - 1.0), (float) (random.NextDouble() * 2.0 - 1.0), 0.0f), ColorEx.TransparentWhite); vertices3[index * 2 + 1] = new FezVertexPositionColor(vertices3[index * 2].Position, Color.White); indices3[index * 2] = index * 2; indices3[index * 2 + 1] = index * 2 + 1; } this.PointsMesh = new Mesh() { Effect = (BaseEffect) new PointsFromLinesEffect(), AlwaysOnTop = true }; Group group3 = this.PointsMesh.AddGroup(); BufferedIndexedPrimitives<FezVertexPositionColor> indexedPrimitives3 = new BufferedIndexedPrimitives<FezVertexPositionColor>(vertices3, indices3, PrimitiveType.LineList); indexedPrimitives3.UpdateBuffers(); indexedPrimitives3.CleanUp(); group3.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives3; this.LevelManager.ActualAmbient = new Color(0.25f, 0.25f, 0.25f); this.LevelManager.ActualDiffuse = Color.White; this.Reset(); }
private static void AddPoints(Group g, Vector3[] pointCenters, Texture texture, float size) { BufferedIndexedPrimitives<VertexFakePointSprite> indexedPrimitives = new BufferedIndexedPrimitives<VertexFakePointSprite>(PrimitiveType.TriangleList); g.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives; indexedPrimitives.Vertices = new VertexFakePointSprite[pointCenters.Length * 4]; indexedPrimitives.Indices = new int[pointCenters.Length * 6]; Random random = RandomHelper.Random; int length = StarField.Colors.Length; VertexFakePointSprite[] vertices = indexedPrimitives.Vertices; int[] indices = indexedPrimitives.Indices; for (int index1 = 0; index1 < pointCenters.Length; ++index1) { Color color = StarField.Colors[random.Next(0, length)]; int index2 = index1 * 4; vertices[index2] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(0.0f, 0.0f), new Vector2(-size, -size)); vertices[index2 + 1] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(1f, 0.0f), new Vector2(size, -size)); vertices[index2 + 2] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(1f, 1f), new Vector2(size, size)); vertices[index2 + 3] = new VertexFakePointSprite(pointCenters[index1], color, new Vector2(0.0f, 1f), new Vector2(-size, size)); int index3 = index1 * 6; indices[index3] = index2; indices[index3 + 1] = index2 + 1; indices[index3 + 2] = index2 + 2; indices[index3 + 3] = index2; indices[index3 + 4] = index2 + 2; indices[index3 + 5] = index2 + 3; } indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); g.Texture = texture; }
private void Reset() { this.FatAxisMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; this.FatAxisMesh.AddColoredBox(new Vector3(1f, 1f, 10000f) / 200f, new Vector3(-0.5f, -0.5f, 0.0f) / 200f, Color.Blue, false); this.FatAxisMesh.Rotation = new Quaternion(-0.7408407f, -0.4897192f, 0.4504161f, 0.09191696f); this.FatAxisMesh.Scale = new Vector3(3f); this.FatAxisMesh.Position = new Vector3(7.574002f, 3.049632f, 5.773395f); if (this.HelixMesh != null && this.HelixMesh.Groups.Count == 1) (this.HelixMesh.FirstGroup.Geometry as BufferedIndexedPrimitives<FezVertexPositionColor>).Dispose(); this.HelixMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; for (int index = 0; index < 750; ++index) { float angle = (float) index / 1f; Group group = this.HelixMesh.AddColoredBox(new Vector3(0.2f, 70f, 0.2f) / 10000f, Vector3.Zero, EndCutscene32Host.PurpleBlack, true); group.Position = new Vector3(0.0f, 0.0f, (float) (((double) index - 375.0) / 3000.0)); group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, angle); } this.HelixMesh.CollapseToBuffer<FezVertexPositionColor>(); this.HelixMesh.Rotation = this.FatAxisMesh.Rotation; this.HelixMesh.Scale = this.FatAxisMesh.Scale; this.HelixMesh.Culling = CullMode.None; Random random = RandomHelper.Random; FezVertexPositionColor[] vertices = new FezVertexPositionColor[200000]; int[] indices = new int[200000]; for (int index = 0; index < 100000; ++index) { vertices[index * 2] = new FezVertexPositionColor(new Vector3((float) random.NextDouble() - 0.5f, (float) random.NextDouble() - 0.5f, 0.0f), new Color((int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), (int) (byte) random.Next(0, 256), 0)); vertices[index * 2 + 1] = new FezVertexPositionColor(vertices[index * 2].Position, new Color((int) vertices[index * 2].Color.R, (int) vertices[index * 2].Color.G, (int) vertices[index * 2].Color.B, (int) byte.MaxValue)); indices[index * 2] = index * 2; indices[index * 2 + 1] = index * 2 + 1; } this.NoiseMesh = new Mesh() { Effect = (BaseEffect) (this.ShimmeringEffect = new ShimmeringPointsEffect()) }; Group group1 = this.NoiseMesh.AddGroup(); BufferedIndexedPrimitives<FezVertexPositionColor> indexedPrimitives = new BufferedIndexedPrimitives<FezVertexPositionColor>(vertices, indices, PrimitiveType.LineList); indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); group1.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives; this.NoiseMesh.Effect.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1f, 1f, 0.1f, 100f)); this.NoiseMesh.Effect.ForcedViewMatrix = new Matrix?(Matrix.CreateLookAt(-Vector3.UnitZ, Vector3.Zero, Vector3.Up)); this.PurpleGradientTexture = this.CMProvider.Global.Load<Texture2D>("Other Textures/end_cutscene/purple_gradient"); }
public override void Initialize() { base.Initialize(); this.LinesMesh = new Mesh() { Effect = (BaseEffect)(this.StaticEffect = new VibratingEffect()) }; FezVertexPositionColor[] vertices1 = new FezVertexPositionColor[5120]; int[] indices1 = new int[5120]; for (int index1 = 0; index1 < 1280; ++index1) { int index2 = 2 * index1; indices1[index2] = index2; vertices1[index2] = new FezVertexPositionColor(new Vector3(-640f, 0.0f, (float)(index1 - 640)), Color.White); int index3 = index2 + 1; indices1[index3] = index3; vertices1[index3] = new FezVertexPositionColor(new Vector3(640f, 0.0f, (float)(index1 - 640)), Color.White); int index4 = index3 + 2559; indices1[index4] = index4; vertices1[index4] = new FezVertexPositionColor(new Vector3((float)(index1 - 640), 0.0f, -640f), Color.White); int index5 = index4 + 1; indices1[index5] = index5; vertices1[index5] = new FezVertexPositionColor(new Vector3((float)(index1 - 640), 0.0f, 640f), Color.White); } Group group1 = this.LinesMesh.AddGroup(); BufferedIndexedPrimitives <FezVertexPositionColor> indexedPrimitives1 = new BufferedIndexedPrimitives <FezVertexPositionColor>(vertices1, indices1, PrimitiveType.LineList); indexedPrimitives1.UpdateBuffers(); indexedPrimitives1.CleanUp(); group1.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives1; Random random = RandomHelper.Random; this.VibratingMesh = new Mesh() { Effect = (BaseEffect)(this.VibratingEffect = new VibratingEffect()) }; FezVertexPositionColor[] vertices2 = new FezVertexPositionColor[500000]; int[] indices2 = new int[998000]; int num1 = 0; int num2 = 0; for (int index1 = 0; index1 < 500; ++index1) { int[] numArray1 = indices2; int index2 = num2; int num3 = 1; int num4 = index2 + num3; int num5 = num1; numArray1[index2] = num5; for (int index3 = 0; index3 < 500; ++index3) { if (index3 != 0) { indices2[num4++] = num1; } vertices2[num1++] = new FezVertexPositionColor(new Vector3((float)(index1 - 250), 0.0f, (float)(index3 - 250)), new Color((int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256))); if (index3 < 498) { indices2[num4++] = num1; } } int[] numArray2 = indices2; int index4 = num4; int num6 = 1; num2 = index4 + num6; int num7 = num1; numArray2[index4] = num7; for (int index3 = 0; index3 < 500; ++index3) { if (index3 != 0) { indices2[num2++] = num1; } vertices2[num1++] = new FezVertexPositionColor(new Vector3((float)(index3 - 250), 0.0f, (float)(index1 - 250)), new Color((int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256), (int)(byte)random.Next(0, 256))); if (index3 < 498) { indices2[num2++] = num1; } } } Group group2 = this.VibratingMesh.AddGroup(); BufferedIndexedPrimitives <FezVertexPositionColor> indexedPrimitives2 = new BufferedIndexedPrimitives <FezVertexPositionColor>(vertices2, indices2, PrimitiveType.LineList); indexedPrimitives2.UpdateBuffers(); indexedPrimitives2.CleanUp(); group2.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives2; this.CubeMesh = new Mesh() { Effect = (BaseEffect) new DefaultEffect.VertexColored() }; this.CubeMesh.AddColoredBox(Vector3.One, Vector3.One, Color.White, true); FezVertexPositionColor[] vertices3 = new FezVertexPositionColor[200000]; int[] indices3 = new int[200000]; for (int index = 0; index < 100000; ++index) { vertices3[index * 2] = new FezVertexPositionColor(new Vector3((float)(random.NextDouble() * 2.0 - 1.0), (float)(random.NextDouble() * 2.0 - 1.0), 0.0f), ColorEx.TransparentWhite); vertices3[index * 2 + 1] = new FezVertexPositionColor(vertices3[index * 2].Position, Color.White); indices3[index * 2] = index * 2; indices3[index * 2 + 1] = index * 2 + 1; } this.PointsMesh = new Mesh() { Effect = (BaseEffect) new PointsFromLinesEffect(), AlwaysOnTop = true }; Group group3 = this.PointsMesh.AddGroup(); BufferedIndexedPrimitives <FezVertexPositionColor> indexedPrimitives3 = new BufferedIndexedPrimitives <FezVertexPositionColor>(vertices3, indices3, PrimitiveType.LineList); indexedPrimitives3.UpdateBuffers(); indexedPrimitives3.CleanUp(); group3.Geometry = (IIndexedPrimitiveCollection)indexedPrimitives3; this.LevelManager.ActualAmbient = new Color(0.25f, 0.25f, 0.25f); this.LevelManager.ActualDiffuse = Color.White; this.Reset(); }
public override void Initialize() { base.Initialize(); this.sBlueZoomOut = this.CMProvider.Get(CM.EndCutscene).Load<SoundEffect>("Sounds/Ending/Cutscene64/BlueZoomOut"); this.sProgressiveAppear = this.CMProvider.Get(CM.EndCutscene).Load<SoundEffect>("Sounds/Ending/Cutscene64/CubesProgressiveAppear"); this.sFadeOut = this.CMProvider.Get(CM.EndCutscene).Load<SoundEffect>("Sounds/Ending/Cutscene64/CubesFadeOut"); this.LevelManager.ActualAmbient = new Color(0.25f, 0.25f, 0.25f); this.LevelManager.ActualDiffuse = Color.White; Random random = RandomHelper.Random; float y1 = 1f / (float) Math.Sqrt(6.0); float z1 = (float) Math.Sqrt(3.0) / 2f; float y2 = (float) Math.Sqrt(2.0 / 3.0); float z2 = (float) (1.0 / (2.0 * Math.Sqrt(3.0))); float x = 1f / (float) Math.Sqrt(2.0); VertexPositionNormalColor[] vertices = new VertexPositionNormalColor[864000]; int[] indices = new int[1296000]; int num1 = 0; int num2 = 0; for (int index1 = -100; index1 < 100; ++index1) { for (int index2 = -180; index2 < 180; ++index2) { Color color = index2 != 0 || index1 != 0 ? MulticoloredSpace.Colors[random.Next(0, MulticoloredSpace.Colors.Length)] : MulticoloredSpace.MainCubeColor; Vector3 vector3 = new Vector3((float) (index2 * 6), (float) (index1 * 6 + (Math.Abs(index2) % 2 == 0 ? 0 : 3)), 0.0f); int num3 = num1; VertexPositionNormalColor[] positionNormalColorArray1 = vertices; int index3 = num1; int num4 = 1; int num5 = index3 + num4; positionNormalColorArray1[index3] = new VertexPositionNormalColor(new Vector3(x, -y1, -z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray2 = vertices; int index4 = num5; int num6 = 1; int num7 = index4 + num6; positionNormalColorArray2[index4] = new VertexPositionNormalColor(new Vector3(x, y1, z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray3 = vertices; int index5 = num7; int num8 = 1; int num9 = index5 + num8; positionNormalColorArray3[index5] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray4 = vertices; int index6 = num9; int num10 = 1; int num11 = index6 + num10; positionNormalColorArray4[index6] = new VertexPositionNormalColor(new Vector3(0.0f, -y2, z2) + vector3, new Vector3(-1f, 0.0f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray5 = vertices; int index7 = num11; int num12 = 1; int num13 = index7 + num12; positionNormalColorArray5[index7] = new VertexPositionNormalColor(new Vector3(0.0f, -y2, z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray6 = vertices; int index8 = num13; int num14 = 1; int num15 = index8 + num14; positionNormalColorArray6[index8] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray7 = vertices; int index9 = num15; int num16 = 1; int num17 = index9 + num16; positionNormalColorArray7[index9] = new VertexPositionNormalColor(new Vector3(-x, y1, z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray8 = vertices; int index10 = num17; int num18 = 1; int num19 = index10 + num18; positionNormalColorArray8[index10] = new VertexPositionNormalColor(new Vector3(-x, -y1, -z2) + vector3, new Vector3(0.0f, 0.0f, -1f), color); VertexPositionNormalColor[] positionNormalColorArray9 = vertices; int index11 = num19; int num20 = 1; int num21 = index11 + num20; positionNormalColorArray9[index11] = new VertexPositionNormalColor(new Vector3(0.0f, y2, -z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray10 = vertices; int index12 = num21; int num22 = 1; int num23 = index12 + num22; positionNormalColorArray10[index12] = new VertexPositionNormalColor(new Vector3(-x, y1, z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray11 = vertices; int index13 = num23; int num24 = 1; int num25 = index13 + num24; positionNormalColorArray11[index13] = new VertexPositionNormalColor(new Vector3(0.0f, 0.0f, z1) + vector3, new Vector3(0.0f, 1f, 0.0f), color); VertexPositionNormalColor[] positionNormalColorArray12 = vertices; int index14 = num25; int num26 = 1; num1 = index14 + num26; positionNormalColorArray12[index14] = new VertexPositionNormalColor(new Vector3(x, y1, z2) + vector3, new Vector3(0.0f, 1f, 0.0f), color); int[] numArray1 = indices; int index15 = num2; int num27 = 1; int num28 = index15 + num27; int num29 = num3; numArray1[index15] = num29; int[] numArray2 = indices; int index16 = num28; int num30 = 1; int num31 = index16 + num30; int num32 = 2 + num3; numArray2[index16] = num32; int[] numArray3 = indices; int index17 = num31; int num33 = 1; int num34 = index17 + num33; int num35 = 1 + num3; numArray3[index17] = num35; int[] numArray4 = indices; int index18 = num34; int num36 = 1; int num37 = index18 + num36; int num38 = num3; numArray4[index18] = num38; int[] numArray5 = indices; int index19 = num37; int num39 = 1; int num40 = index19 + num39; int num41 = 3 + num3; numArray5[index19] = num41; int[] numArray6 = indices; int index20 = num40; int num42 = 1; int num43 = index20 + num42; int num44 = 2 + num3; numArray6[index20] = num44; int[] numArray7 = indices; int index21 = num43; int num45 = 1; int num46 = index21 + num45; int num47 = 4 + num3; numArray7[index21] = num47; int[] numArray8 = indices; int index22 = num46; int num48 = 1; int num49 = index22 + num48; int num50 = 6 + num3; numArray8[index22] = num50; int[] numArray9 = indices; int index23 = num49; int num51 = 1; int num52 = index23 + num51; int num53 = 5 + num3; numArray9[index23] = num53; int[] numArray10 = indices; int index24 = num52; int num54 = 1; int num55 = index24 + num54; int num56 = 4 + num3; numArray10[index24] = num56; int[] numArray11 = indices; int index25 = num55; int num57 = 1; int num58 = index25 + num57; int num59 = 7 + num3; numArray11[index25] = num59; int[] numArray12 = indices; int index26 = num58; int num60 = 1; int num61 = index26 + num60; int num62 = 6 + num3; numArray12[index26] = num62; int[] numArray13 = indices; int index27 = num61; int num63 = 1; int num64 = index27 + num63; int num65 = 8 + num3; numArray13[index27] = num65; int[] numArray14 = indices; int index28 = num64; int num66 = 1; int num67 = index28 + num66; int num68 = 10 + num3; numArray14[index28] = num68; int[] numArray15 = indices; int index29 = num67; int num69 = 1; int num70 = index29 + num69; int num71 = 9 + num3; numArray15[index29] = num71; int[] numArray16 = indices; int index30 = num70; int num72 = 1; int num73 = index30 + num72; int num74 = 8 + num3; numArray16[index30] = num74; int[] numArray17 = indices; int index31 = num73; int num75 = 1; int num76 = index31 + num75; int num77 = 11 + num3; numArray17[index31] = num77; int[] numArray18 = indices; int index32 = num76; int num78 = 1; num2 = index32 + num78; int num79 = 10 + num3; numArray18[index32] = num79; } } this.CubesMesh = new Mesh() { Effect = (BaseEffect) (this.CubesEffect = (DefaultEffect) new DefaultEffect.LitVertexColored()), DepthWrites = false, AlwaysOnTop = true }; Group group = this.CubesMesh.AddGroup(); BufferedIndexedPrimitives<VertexPositionNormalColor> indexedPrimitives = new BufferedIndexedPrimitives<VertexPositionNormalColor>(vertices, indices, PrimitiveType.TriangleList); indexedPrimitives.UpdateBuffers(); indexedPrimitives.CleanUp(); group.Geometry = (IIndexedPrimitiveCollection) indexedPrimitives; this.PointsMesh = new Mesh() { Effect = (BaseEffect) new PointsFromLinesEffect(), DepthWrites = false, AlwaysOnTop = true }; Color[] colorArray = new Color[32640]; Vector3[] vector3Array = new Vector3[32640]; int index33 = 0; for (int index1 = -68; index1 < 68; ++index1) { for (int index2 = -120; index2 < 120; ++index2) { vector3Array[index33] = new Vector3((float) index2 / 8f, (float) ((double) index1 / 8.0 + (Math.Abs(index2) % 2 == 0 ? 0.0 : 1.0 / 16.0)), 0.0f); colorArray[index33++] = RandomHelper.InList<Color>(MulticoloredSpace.Colors); } } this.PointsMesh.AddPoints((IList<Color>) colorArray, (IEnumerable<Vector3>) vector3Array, true); }