Jump to content

Adjusting clipping plane for Cameras


Recommended Posts

Hey there!

I'm working on an update to Telemachus that will allow you to get screenshots of cameras in KSP. I've successfully been able to render cameras to images, but I'm running into some problems with the clipping plane. In short, I can see that the default clipping plane for "Camera 00" is 310, and it looks like there are multiple cameras used to render the image. Some of the cameras have very long clipping distances.

I've been digging into the RasterPropMonitor code and I haven't been able to figure out how it handles creating the camera (especially determining the clipping plane so that it renders what the player expects). The RasterPropMonitor code for creating FlyingCameras is: https://github.com/Mihara/RasterPropMonitor/blob/fa9c57dee50c661cb91d36253508e5ee86ccdb09/RasterPropMonitor/Core/FlyingCamera.cs

Below is a gist of the quick and dirty code I've come up with so far, an example screenshot, and some debug info I put together.

Thanks for the help! With the 1.1+ changes and the number of cameras I'm expecting to render, I want to make sure this feature is efficient and won't eat all the RAM it can find :)

The Github Gist is here: https://gist.github.com/tcannonfodder/65d68d7fc8038992de61a1f7116bb24d

Render example

9me3nhY.png

 

Link to comment
Share on other sites

My comment from your reddit post in case you didn't see it

Quote

I'm not 100% what you're trying to achieve but if you are confused with how the cameras are set up then you should know that different cameras are used for different ranges which are pieced together.
Here is a video talking a bit more about it and here is a screenshot from it (at 14:11) which sums up what I'm rambling on about.

edit: also I have written two mods that access the default ksp cameras. Kerbal Greenscreen Mod and Controllable Rover Mastcam -These should hopefully give you more idea of what is going on.

 

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...