Search the Community

Showing results for tags 'conics'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • The Daily Kerbal
  • General KSP
    • KSP Discussion
    • Suggestions & Development Discussion
    • Challenges & Mission ideas
    • The Spacecraft Exchange
    • KSP Fan Works
  • Gameplay and Technical Support
    • Gameplay Questions and Tutorials
    • Technical Support (PC, unmodded installs)
    • Technical Support (PC, modded installs)
    • Technical Support (PlayStation 4, XBox One)
  • Add-ons
    • Add-on Discussions
    • Add-on Releases
    • Add-on Development
  • Community
    • Welcome Aboard
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
  • Making History Expansion
    • Making History Missions
    • Making History Discussion
    • Making History Support
  • International
    • International
  • KerbalEDU Forums
    • KerbalEDU
    • KerbalEDU Website

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


Location


Interests

Found 3 results

  1. Hello everyone, Whitecat here with a question about drawing and rendering lines in the tracking station. Basically for my Orbital Decay modification I am beginning to implement n-body simulation, the actual simulation and orbit movements are fine, however such movements are 'forbidden' by the tracking station conics system. e.g, An orbit must ellipsoidal under all circumstances forever... Similarly during timewarp the whole affair gets horrifically messy and would make any sort of space rendezvous beyond 1/2 Hill Sphere radii impossible. However I have a found a solution to this by removing the stock conic rendering for a certain vessel and creating a stepped prediction for the orbit shape and size at various points using position vectors across a period of time. Creating a 'line of best fit path between them. Alas during implementation of this an exception is thrown, Personally I have no experience of any line rendering past creating a GUI, so I have been following the code of Remote Tech's line drawing as a guide. If anyone could shed light on any issues with the code below I would be very grateful! foreach (Orbit orbit in FutureRenderOrbits) { Vector3 PositionAtStart = orbit.getTruePositionAtUT(time + (TimeSnapshots * FutureRenderOrbits.IndexOf(orbit))); Vector3 PositionAt1stDegree = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + (1.0 / 6.0)))); Vector3 PositionAt2ndDegree = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + (2.0 / 6.0)))); Vector3 PositionAt3rdDegree = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + (3.0 / 6.0)))); Vector3 PositionAt4thDegree = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + (4.0 / 6.0)))); Vector3 PositionAt5thDegree = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + (5.0 / 6.0)))); Vector3 PositionAtEnd = orbit.getTruePositionAtUT(time + (TimeSnapshots * (FutureRenderOrbits.IndexOf(orbit) + 1))); MeshRenderer OrbitBezierRenderer= new MeshRenderer(); MeshFilter OrbitBezierFilter = new MeshFilter(); GameObject OrbitBezier = new GameObject("OrbitBezierLine"); if (gameObject.GetComponent<MeshRenderer>() == null) { OrbitBezierRenderer = gameObject.AddComponent<MeshRenderer>(); } if (gameObject.GetComponent<MeshFilter>() == null) { OrbitBezierFilter = gameObject.AddComponent<MeshFilter>(); } OrbitBezierFilter.mesh = new Mesh(); OrbitBezierFilter.mesh.name = "OrbitBezierLine"; OrbitBezierFilter.mesh.vertices = new Vector3[5]; OrbitBezierFilter.mesh.uv = new Vector2[5] { new Vector2(0, 1), new Vector2(0,1), new Vector2(0, 0), new Vector2(1, 1), new Vector2(1, 0) }; OrbitBezierFilter.mesh.SetIndices(new int[] { 0, 2, 1, 2, 3, 1 }, MeshTopology.Triangles, 0); OrbitBezierFilter.mesh.colors = Enumerable.Repeat(Color.red, 5).ToArray(); lineMaterial = MapView.fetch.orbitLinesMaterial; OrbitBezierRenderer.material = lineMaterial; Vector3[] Points2D = new Vector3[4]; Vector3[] Points3D = new Vector3[5]; float LineWidth = 1.0f; var camera = PlanetariumCamera.Camera; var start = camera.WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(PositionAtStart)); var end = camera.WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(PositionAtEnd)); var segment = new Vector3(end.y - start.y, start.x - end.x, 0).normalized * (LineWidth / 2); if (!MapView.Draw3DLines) { var dist = Screen.height / 2 + 0.01f; start.z = start.z >= 0.15f ? dist : -dist; end.z = end.z >= 0.15f ? dist : -dist; } OrbitBezier.layer = 31; Points3D[0] = camera.ScreenToWorldPoint(PositionAt1stDegree); Points3D[1] = camera.ScreenToWorldPoint(PositionAt2ndDegree); Points3D[2] = camera.ScreenToWorldPoint(PositionAt3rdDegree); Points3D[3] = camera.ScreenToWorldPoint(PositionAt4thDegree); Points3D[4] = camera.ScreenToWorldPoint(PositionAt5thDegree); OrbitBezierFilter.mesh.vertices = MapView.Draw3DLines ? Points3D : Points2D; OrbitBezierFilter.mesh.RecalculateBounds(); OrbitBezierFilter.mesh.MarkDynamic(); Please note: Only 6 degrees of Position vectors during a time interval are being shown here, in reality during a high (1000x time warp) around 50 position vectors will be necessary to ensure accuracy of the tracing. The intention of the code is to draw a 'dot to dot' between the position vectors at the start and end of an orbit snapshot (since the orbit will be changed regularly due to n-body perturbation), using the PositionAtNthDegree vectors to provide vertex points to 'beziate' the line to the correct (accurate) orbital curvature. Feedback on how to make the above code actually render a line or two, or even a better method of drawing bezier curves in the Planetarium view would be greatly appreciated! Thanks for your time! Whitecat106
  2. Hello, i am learning to use Unity3d, and one of the things i wouldn't know how to do in KSP is to display the patchedConics, especially when they are rescaled and reformed so quickly. I bet they are not mesh renderers, but what are they? I hope you don't consider this to be undisclosable because i would really like to know and is driving me crazy... thank you Edit: sorry just realised there are line renderers...
  3. Hello all, I recently purchased the game and already had a lot of fun with it. I read many help posts as well so thank you for the help so far. I'm experiencing a strange behaviour of the orbit displayed (conics I believe ?) when I'm changing from a body SOI to another. For example, assume I'm orbiting the Mun (yay !) and I want to go back to Kerbin. I'll play with the manoeuver nodes until I get a nice Kerbin orbit after exiting the Mun's sphere of influence. I'll execute the manoeuver not too badly and then, right after I exit (end of the blue trajectory), the orbit will completely change and I don't understand why. But there's more. After a short time, the orbit will get back to what it was supposed to be. Has anyone seen this before and could tell me what's happening ? I can't say if the problem also exist with other bodies as I'm still at the very beginning. All my settings are default (I think), but I do have a few mods installed. If I didn't provide enough information, please ask for more.