private void constructSkaia() { godTierInnerSpiro = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(45), new Color(182, 251, 255, 100), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 1.png")); godTierInnerSpiro.depthBias = -0.02f; godTierInnerSpiro.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1)); godTierInnerFill = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(45), new Color(0, 197, 255, 66), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 2.png")); godTierInnerFill.depthBias = -0.01f; godTierInnerFill.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1)); godTierOuterSpiro = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(67), new Color(182, 251, 255, 66), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 1.png")); godTierOuterSpiro.depthBias = -0.04f; godTierOuterSpiro.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1)); godTierOuterFill = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(67), new Color(0, 197, 255, 66), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//God Tier 2.png")); godTierOuterFill.depthBias = -0.03f; godTierOuterFill.AddModifier(new BillboardRotateModifier3D(0.0005f, true, false, -1)); glowEffect = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(40), new Color(0, 197, 255, 128), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//Glow.png")); glowEffect.depthBias = -0.05f; godTierSymbol = new TexturedPlane(new Vector3(0, 8, 0), Quaternion.Identity, new Vector2(7), new Color(0, 0, 0, 255), true, ScreenManager.Content.Load <Texture2D>(".//Miscellaneous//of Breath.png")); godTierSymbol.depthBias = -0.06f; lowerSpirograph = new Spirograph(1f, 10f / 7f, 7, 1, 12, 0, Color.White); lowerSpirograph.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0, MathHelper.PiOver2); lowerSpirograph.WorldPosition = new Vector3(0, 2, 0); lowerSpirograph.AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(-0.01f, 0, 0), false, -1)); lowerSpirograph.Generate(600); reckoningGates = new Spirograph[50]; }
public void Initialize(float distFromCenter, float orbitAngle, float orbitSpeed) { gates = new Spirograph[7]; if (PlayerEntered == true) { plane.Color = Color.White; planeOrbit = new OrbitModifier3D(new Vector3(0, 8, 0), Vector3.Up, distFromCenter, orbitAngle, orbitSpeed, plane, false, -1); plane.AddModifier(planeOrbit); lowerSpirograph = new Spirograph(1f, 10f / 7f, 7, 1, 3, 0, PrimaryColor); lowerSpirograph.AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(0.02f, 0, 0), false, -1)); } else { plane.Color = new Color(50, 50, 50); planeOrbit = new OrbitModifier3D(Vector3.Zero, Vector3.Up, distFromCenter, orbitAngle, orbitSpeed, plane, false, -1); plane.AddModifier(planeOrbit); lowerSpirograph = new Spirograph(1f, 10f / 7f, 7, 0.4f, 3, 0, Color.Lerp(PrimaryColor, Color.Black, 0.8f)); lowerSpirograph.AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(-0.01f, 0, 0), false, -1)); } lowerSpirograph.Generate(300); lowerSpiroOrbit = new OrbitModifier3D(Vector3.Zero, Vector3.Up, distFromCenter, orbitAngle, orbitSpeed, lowerSpirograph, false, -1); lowerSpirograph.AddModifier(lowerSpiroOrbit); lowerSpirograph.Rotation = Quaternion.CreateFromYawPitchRoll(0, 0, MathHelper.PiOver2); for (int i = 0; i < 7; i++) { float gateDist = ((distFromCenter - 20) / 7) * (6 - i) + 20; if (PlayerEntered == true) { gates[i] = new Spirograph(1f, 10f / 7f, 7, 1, 0.2f, 0, SecondaryColor); gates[i].Generate(140); } else { gates[i] = new Spirograph(1f, 10f / 7f, 7, 1, 0.2f, 0, Color.TransparentBlack); gates[i].Generate(140); } gates[i].Rotation = Quaternion.CreateFromYawPitchRoll(orbitAngle, 0, 0);//(MathHelper.TwoPi - (MathHelper.TwoPi / currentSession.Lands.Length)) * i gates[i].AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(-orbitSpeed, 0, 0), false, -1)); gates[i].WorldPosition = new Vector3(0, 8, 0); gates[i].AddModifier(new OrbitModifier3D(new Vector3(0, 8, 0), Vector3.Up, gateDist, orbitAngle, orbitSpeed, gates[i], false, -1)); } }
public override void LoadContent() { ScreenManager.Content = new DynamicContentManager(ScreenManager.StaticGame, ScreenManager.StaticGame.Content.RootDirectory); base.LoadContent(); spirograph = new Spirograph(1, 10f / 7f, 7, 1, 1, 300, new Color(0, 30, 0)); camera = new SphericalCamera(Vector3.Zero, new Vector2(0, 90), 12); ScreenManager.Globals.Camera = camera; camera.InputIndependent = true; spirograph.Generate(600); spirograph.AddModifier(new RotateModifier3D(Quaternion.CreateFromYawPitchRoll(0, -0.01f, 0), false, -1)); spirograph.AddModifier(new SpirographLerpModifier(-1, -1, -1, -1, 1, false, spirograph, 300)); spirograph.AddModifier(new ColorModifier3D(new Color(100, 255, 100), false, spirograph, 300)); flashComplete = false; shrinkComplete = false; growComplete = false; preloadContentThread = new Thread(new ThreadStart(Preload)); preloadContentThread.Start(); ScreenManager.IsMouseVisible = false; }
public void RunFormsMode(System.Windows.Forms.Form frm) { this.Reset(); this._formsMode = true; Spirograph spiro = new Spirograph(frm.Handle, Color.Black); frm.FormClosed += delegate { this.Stop(); }; //frm.ResizeEnd += delegate //{ // spiro.ResetDeviceContext(); //}; frm.SizeChanged += delegate { spiro.ResetDeviceContext(); }; frm.KeyPress += delegate { spiro.Reset(); }; frm.VisibleChanged += delegate { if (RainstormStudios.Unmanaged.Win32.IsWindowVisible(frm.Handle) && spiro.Paused) { spiro.Resume(); } else if (!RainstormStudios.Unmanaged.Win32.IsWindowVisible(frm.Handle) && !spiro.Paused) { spiro.Pause(); } }; this._forms.Add(frm); this._screens.Add(spiro); this.StartScreens(); }
/// <summary> /// This causes the owner spirograph to change to the passed-in values over [time] frames. /// </summary> /// <param name="smallerRadius">Value to interpolate the outer radius to. 0 or less to keep the old value.</param> /// <param name="largerRadius">Value to interpolate the inner radius to. 0 or less to keep the old value.</param> /// <param name="radians">Value to interpolate the radians to. 0 or less to keep the old value.</param> /// <param name="distanceToPoint">Value to interpolate the distance to point to. 0 or less to keep the old value.</param> /// <param name="time">Time, in frames, that this function will take to complete. Must be greater than -1.</param> public SpirographLerpModifier(float smallerRadius, float largerRadius, float radians, float distanceToPoint, float scalar, bool removeIfComplete, Spirograph owner, int time) { if (time > 0) { RemoveIfComplete = removeIfComplete; Owner = owner; if (smallerRadius > 0) { targetSmallRadius = smallerRadius * scalar; } else { targetSmallRadius = owner.smallerRadius; } if (distanceToPoint > 0) { targetDist = distanceToPoint * scalar; } else { targetDist = owner.distToPoint; } if (largerRadius > 0) { targetLargeRadius = largerRadius * scalar; } else { targetLargeRadius = owner.largerRadius; } if (radians > 0) { targetRadians = radians; } else { targetRadians = owner.radians; } frames = time; lerpSpeed = new Vector4((owner.smallerRadius - targetSmallRadius) / (float)time, (owner.largerRadius - targetLargeRadius) / (float)time, (owner.radians - targetRadians) / (float)time, (owner.distToPoint - targetDist) / (float)time); if (lerpSpeed.X > 0) { sRadiusWasSmaller = false; } else { sRadiusWasSmaller = true; } if (lerpSpeed.Y > 0) { lRadiusWasSmaller = false; } else { lRadiusWasSmaller = true; } if (lerpSpeed.Z > 0) { radiansWasSmaller = false; } else { radiansWasSmaller = true; } if (lerpSpeed.W > 0) { distWasSmaller = false; } else { distWasSmaller = true; } Active = true; } }