Jump to content

Scotti

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Scotti

  1. Thank you Faark and EndlessWaves. I figured out what my issue was and it didn't have anything to do with any of the methods from CelestialBody. My issue was that I was using "Camera.main.WorldToScreenPoint()". It seems that jumping from Flight to Map view and back changes Camera.main to the UICamera instead of Camera 00. So I'm now using "FlightCamera.fetch.mainCamera" as my reference. Faark, you were right on in thinking that my issue could be the re-positioning of objects. During my debugging ( writing LOTS of traces ) I think I learned a lot about how Krakensbane might work. I can at least write what I think I learned for the benefit of others. Please let me know how close I get. Vector3d surfaceNVector = vessel.mainBody.GetSurfaceNVector(geoCoord.Latitud e.NormalAngle, geoCoord.Longitude.NormalAngle); Vector3d surfaceVector3D = vessel.mainBody.position + (vessel.mainBody.Radius * surfaceNVector); surfaceNVector is the relative direction to the surface where lat long is. Multiplying it by Radius takes you to the relative surface position of lat long. Adding it to body.position makes that relative position a world position. from time to time and when you jump in and out of map view. Krakensbane takes your vessel and makes it the center of the universe and re-positions everything around you to fit within Unity's Vector3 floats. Jumping into Map view seems to shrink or scale everything down so the entire solar system can fit within the Vector3. Which is why the ship position is reset when you return from it, I guess. This is why my my SurfaceVector3D reset to being straight below the vessel. With all that said. It would be nice if Squad could create a Development Build with Script Debugging so we can set breakpoints and step through things. Being able to do that would have saved a lot of time. Thanks again y'all.
  2. Yes. I started out with that and everything was working great until I hopped into and out of map view. ( Planetarium? ) Then I started Googling for snipits of example code and found out that calculation above basically generated the same numbers as GetWorldSurfacePostion(lat, lon, 0.0f).
  3. Faark, Thanks for your reply. I've very new to all of this so I really appreciate the assistance. The difference in real time between going in and out of map view is about 5 seconds those numbers are updated every OnFixedUpdate I'm not saving any data. From the camera point of view my marker was on the ground and now it looks like its right up by the vessel. I'm not sure what I would use as a known reference. Also, I tried using CelestialBody.GetWorldSurfacePosition and the the same thing happens. Maybe a better question to ask is what is a reliable way given Lat, Long, to get a Vector3d that is relative to the world position of the vessel of that position on a bodies surface?
  4. So I use the follow calculations in flight mode regular view to draw some stuff on the ground. Vector3d surfaceNVector = vessel.mainBody.GetSurfaceNVector(geoCoord.Latitude.NormalAngle, geoCoord.Longitude.NormalAngle); Vector3d surfaceVector3D = vessel.mainBody.position + (vessel.mainBody.Radius * surfaceNVector); I press M to go into map view and then M again to return and now those numbers are way off. Why would they be so different after returning from map view? Everything still looks correct, just the surfaceVector3D is very different. Example. I'm using DoubleConverter to fetch the whole double to string. I added vessel position in vector3 just to show that my ships position had not changed. Before mapview. vessel.position= (1442.5, -46.4, -302.2) body.position= 129187.193202878246665932238101959228515625, -6156.2309592617975795292295515537261962890625, 686391.0464513562619686126708984375 SurfaceNVector= -0.0887034059184583778545629684231244027614593505859375, 0.00578425817552570553647939277652767486870288848876953125, -0.9960412883690235030798021398368291556835174560546875 body.Radius= 600000 Radius * surfaceNVector= -53222.043551075024879537522792816162109375, 3470.55490531542318421998061239719390869140625, -597624.773021414061076939105987548828125 surfaceVector3D= 75965.14965180322178639471530914306640625, -2685.67605394637439530924893915653228759765625, 88766.273429942200891673564910888671875 After coming back from mapview. vessel.position= (1442.6, -46.4, -301.7) body.position= 121576.205192791647277772426605224609375, -5910.33500358540550223551690578460693359375, 687781.159533579251728951930999755859375 SurfaceNVector= -0.202680362274793690602336937445215880870819091796875, 0.0098522251209750520695163089612833573482930660247802734375, -0.97919538622704094255055906614870764315128326416015625 body.Radius= 600000 Radius * surfaceNVector= -121608.21736487621092237532138824462890625, 5911.3350725850314120179973542690277099609375, -587517.2317362246103584766387939453125 surfaceVector3D= -32.01217208456364460289478302001953125, 1.0000689996259097824804484844207763671875, 100263.927797354641370475292205810546875
  5. Thanks hoojiwana! Now I can see if I have as good a luck modeling as I did writing some camera mods.
  6. The web site that hosted the link for Mu's PartTools package has been replaced with another site and the link to the package is now defunct. Does anyone have a mirror to that package or is there another way to generate the .mu models and related files for parts from Unity? Thanks, Scotti
  7. The whole site file2web.com is gone. Its now gamesdot.org. Is there a mirror for the part tools?
×
×
  • Create New...