public override void Initialize() { base.Initialize(); PolytronLogo polytronLogo = this; Mesh mesh1 = new Mesh(); mesh1.AlwaysOnTop = true; Mesh mesh2 = mesh1; DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored(); vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1.428571f, 1.428571f, 0.1f, 100f)); vertexColored1.ForcedViewMatrix = new Matrix?(Matrix.CreateLookAt(Vector3.UnitZ, -Vector3.UnitZ, Vector3.Up)); DefaultEffect.VertexColored vertexColored2 = vertexColored1; mesh2.Effect = (BaseEffect) vertexColored2; Mesh mesh3 = mesh1; polytronLogo.LogoMesh = mesh3; for (int index1 = 0; index1 < 4; ++index1) { FezVertexPositionColor[] vertices = new FezVertexPositionColor[202]; for (int index2 = 0; index2 < vertices.Length; ++index2) vertices[index2] = new FezVertexPositionColor(Vector3.Zero, PolytronLogo.StripColors[index1]); this.LogoMesh.AddGroup().Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives<FezVertexPositionColor>(vertices, Enumerable.ToArray<int>(Enumerable.Range(0, vertices.Length)), PrimitiveType.TriangleStrip); } float viewScale = SettingsManager.GetViewScale(this.GraphicsDevice); int width = this.GraphicsDevice.Viewport.Width; int height = this.GraphicsDevice.Viewport.Height; this.LogoMesh.Position = new Vector3(-0.1975f, -0.25f, 0.0f); this.LogoMesh.Scale = new Vector3(new Vector2(500f) * viewScale / new Vector2((float) width, (float) height), 1f); bool flag = (double) viewScale >= 1.5; this.sPolytron = this.CMProvider.Get(CM.Intro).Load<SoundEffect>("Sounds/Intro/PolytronJingle"); this.PolytronText = this.CMProvider.Get(CM.Intro).Load<Texture2D>("Other Textures/splash/polytron" + (flag ? "_1440" : "")); this.spriteBatch = new SpriteBatch(this.GraphicsDevice); }
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(); PolytronLogo polytronLogo = this; Mesh mesh1 = new Mesh(); mesh1.AlwaysOnTop = true; Mesh mesh2 = mesh1; DefaultEffect.VertexColored vertexColored1 = new DefaultEffect.VertexColored(); vertexColored1.ForcedProjectionMatrix = new Matrix?(Matrix.CreateOrthographic(1.428571f, 1.428571f, 0.1f, 100f)); vertexColored1.ForcedViewMatrix = new Matrix?(Matrix.CreateLookAt(Vector3.UnitZ, -Vector3.UnitZ, Vector3.Up)); DefaultEffect.VertexColored vertexColored2 = vertexColored1; mesh2.Effect = (BaseEffect)vertexColored2; Mesh mesh3 = mesh1; polytronLogo.LogoMesh = mesh3; for (int index1 = 0; index1 < 4; ++index1) { FezVertexPositionColor[] vertices = new FezVertexPositionColor[202]; for (int index2 = 0; index2 < vertices.Length; ++index2) { vertices[index2] = new FezVertexPositionColor(Vector3.Zero, PolytronLogo.StripColors[index1]); } this.LogoMesh.AddGroup().Geometry = (IIndexedPrimitiveCollection) new IndexedUserPrimitives <FezVertexPositionColor>(vertices, Enumerable.ToArray <int>(Enumerable.Range(0, vertices.Length)), PrimitiveType.TriangleStrip); } float viewScale = SettingsManager.GetViewScale(this.GraphicsDevice); int width = this.GraphicsDevice.Viewport.Width; int height = this.GraphicsDevice.Viewport.Height; this.LogoMesh.Position = new Vector3(-0.1975f, -0.25f, 0.0f); this.LogoMesh.Scale = new Vector3(new Vector2(500f) * viewScale / new Vector2((float)width, (float)height), 1f); bool flag = (double)viewScale >= 1.5; this.sPolytron = this.CMProvider.Get(CM.Intro).Load <SoundEffect>("Sounds/Intro/PolytronJingle"); this.PolytronText = this.CMProvider.Get(CM.Intro).Load <Texture2D>("Other Textures/splash/polytron" + (flag ? "_1440" : "")); this.spriteBatch = new SpriteBatch(this.GraphicsDevice); }
public override void Initialize() { base.Initialize(); LogoMesh = new Mesh { AlwaysOnTop = true }; for (int i = 0; i < StripColors.Length; i++) { FezVertexPositionColor[] vertices = new FezVertexPositionColor[202]; for (int j = 0; j < vertices.Length; j++) { vertices[j] = new FezVertexPositionColor(Vector3.Zero, StripColors[i]); } LogoMesh.AddGroup().Geometry = new IndexedUserPrimitives <FezVertexPositionColor>(vertices, Enumerable.Range(0, vertices.Length).ToArray(), PrimitiveType.TriangleStrip); } float viewScale = GraphicsDevice.GetViewScale(); float xScale = GraphicsDevice.Viewport.Width / (1280f * viewScale); float yScale = GraphicsDevice.Viewport.Height / (720f * viewScale); int width = GraphicsDevice.Viewport.Width; int height = GraphicsDevice.Viewport.Height; LogoMesh.Position = new Vector3(-0.1975f / xScale, -0.25f / yScale, 0f); LogoMesh.Scale = new Vector3(new Vector2(500f) * viewScale / new Vector2(width, height), 1f); sPolytron = CMProvider.Get(CM.Intro).Load <SoundEffect>("Sounds/Intro/PolytronJingle"); DrawActionScheduler.Schedule(delegate { PolytronText = CMProvider.Get(CM.Intro).Load <Texture2D>("Other Textures/splash/polytron_neue" + (viewScale >= 1.5f ? "_1440" : "")); spriteBatch = new SpriteBatch(GraphicsDevice); LogoMesh.Effect = new DefaultEffect.VertexColored { ForcedProjectionMatrix = Matrix.CreateOrthographic(320f / 224f, 320f / 224f, 0.1f, 100f), ForcedViewMatrix = Matrix.CreateLookAt(Vector3.UnitZ, -Vector3.UnitZ, Vector3.Up) }; }); }
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 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(); }