- Home /
Centering Camera Viewport Rect?
I have a Camera and I would like to render a portion of its view whilst maintaining the objects current position on screen. So - for example:
I have a view with a couple of objects in it like the below image: http://s4.postimg.org/rzaqyr3ot/Image1.png
I would like to render a portion of the view whilst maintaining the objects onscreen positions - like this image: http://s2.postimg.org/l4z6x5lbt/Image2.png
The problem is that modifying the viewport rect centers on the object (for obvious reasons) thus adjusting their onscreen position like this: http://s2.postimg.org/xyx8qhyrd/Image3.png
Does anyone have any tips for how I might go about solving this?
Thanks in advance!
George
Answer by GeorgeIng · May 27, 2015 at 10:21 AM
Answering my own question! What I wanted was to scissor the rectangle.
You can find more about it here: http://forum.unity3d.com/threads/scissor-rectangle.37612/
Your answer
![](https://koobas.hobune.stream/wayback/20220613200330im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Translate GetWorldCorners (new UI) to Viewport for a camera rect 1 Answer
How does the aspect ratio work? 0 Answers
Changing the Camera viewport rect results in resizing the objects rendered by the specific camera ? 1 Answer
Having Issues with Camera Viewport Rect 0 Answers
Restrict 2D camera with a Quad? 0 Answers