Jump to content

Map Layer over orbit lines?


Recommended Posts

I'm drawing a primitive on the map layer and am trying to get it to show over the item over orbit lines when they intersect.

I got it to work when setting to object to layer 31 which is used for drawing vector lines, but it only works when viewing at a planet level zoom.
If I start to zoom out, when I see that system orbit lines start to be drawn, the object I was able to see, goes invisible.

Is there a property I'm missing to allow this to be viewed at a system zoomed out level? Or might this be something to do with 'when' I'm drawing the object at the BetterLateThanNever update stage.

Edited by wile1411
Link to comment
Share on other sites

It's not (only) a "when" issue but a "with which camera"/"Clipping plane" issue. I had the exact same problem when working the debug lines I posted a few weeks ago 

 The solution is in there but gist is blocked at work so I can't point it out right now :)

Link to comment
Share on other sites

Err. Not sure the code will actually help but the problem is the same. Your item is rendered on by a camera that has a short farclip plane. So it depends on what you use to draw your gizmos

Link to comment
Share on other sites

Thanx once again @sarbian. I haven't even set a camera for what I'm doing as was just using a renderer to draw my procedural primitive. I see where in your example where you set this and will play around with that.

Is there somewhere I can read up on the knowledge I'd need to know on which camera I should use for specific conditions? Also what is the default camera if you don't specify one?

Edit: Actually better question would be is there any difference in the cameras when viewing from Map vs Tracking station?

 

 

Edited by wile1411
Link to comment
Share on other sites

It's a bit complex. All KSP point of view uses at least 2 camera. One for the objects that are near and a second one for far objects. The map uses a few more for effect but I don't think you need to bother about there here. JPLRepo has a nice post about the main "camera" there. it is the same for the map/Tracking station cam.

I don't remember how the layers are mapped but you will have to check if  31 is active on both cameras. To get them I guess the easiest way would be to grab PlanetariumCamera.Camera parent and then search for all child Camera. PlanetariumCamera.Camera.transform.parent.getComponentInChildren<Camera>() (or something close)

Link to comment
Share on other sites

Interesting post, thanks.

To get a rough idea about the purpose of each layer check this post :

Edit : @wile1411 try the layer 24 (MapFX), it solve an issue in my mod Antenna Helper, the circle disappearing when zoomed far away.

Edited by Li0n
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...