- Home /
Is it possible to show only a part of what camera sees?
Hello, I have a perspective camera but I would only like to show a part of what it sees, like the upper half, or a rectangle part of it. Changing the Field of View is not the solution for me because it affects the perspective. Basically, what I would like is the perspective which I get with FoV 60, and the size of the shot (relative to the world) as if the FoV were something like 30.
What part of the documentation did you not understand?
Hi, thanks, but I'm not sure you understood my question. You point me to camera.pixelRect which defines "Where on the screen is the camera rendered" but I don't need to control where the camera is rendered (I want a regular full screen render) - but what part of the camera is rendered. What I need is like having the camera rendered on a plane and then "fil$$anonymous$$g" just a part of that plane with the second camera.
I think what you're looking for is rendertextures. http://docs.unity3d.com/ScriptReference/RenderTexture.html
Using these you can set up a "projector" to show the rendered texture onto something in your scene which your camera can render a part of.
It always helps to be as specific as possible on this site.
I guess you're talking about the camera Viewport, right? if it is so just change the relative parameters in the inspector named Viewport Rect
Hi, Thanks, again. I'm sorry for not making myself clear. I'll try explaining the problem with example test shots, down below. Smoogach, I know how to do the thing with two cameras, but I'm thinking it is kind of irrational performance-wise to do it that way because I need it throughout the entire game. I was hoping there is another simpler solution. f4bo, again i don't think changing the viewport is what I need.
This is one possible view of my game:
I would like to lose the perspective of the floor, so I move the camera down, and get this (ignore the yellow rectangle for now):
But then I get (the lower) half of my screen empty and useless so i would only like to crop this yellow rectangle of it and make it full screen. I could get the desired effect of loosing the floor perspective by repositioning all the objects in the world, but then they wouldn't be positioned realistically and that would make the scene confusing to work with in the editor.
I will do some more testing, but if I just move the camera closer and rotate it I get too much perspective distortion on high objects - that is why i'm searching for a solution that doesn't involve moving the camera closer (nor changing the Field of view, for similar reasons). If I come to a solution, or a better explanation of the problem I'll post it here. Thanks!
Answer by f4bo · Jan 01, 2015 at 02:39 PM
ok now it is a bit more clear - so you want the camera will move forward as close as its z axis get closer to 0 - i think you just need to add to the camera movement script, something that, indeed, just change the y value according with the z position in a way that y will be reduced together with z getting closer to 0.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175259im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
FOV script does not change camera FOV on executable, but it does in the unity playtest. 0 Answers
Unity3d or Maya-style Camera navigation 5 Answers
Help Please - 2D Game Perspective Camera 2 Answers
Camera follow help? 1 Answer
Is it possible to shake the screen rather than shake the camera? 3 Answers