Change camera origin point to top left?
is it possible to to change the camera's origin point(the cameras 0,0 position) to the top left corner of the camera itself?
right now it look like the camera's origin(0,0) is the center
Answer by NoseKills · Aug 31, 2016 at 06:46 AM
Yes and no. I'm having a hard time answering since the approach here seems a bit off.
The short answer is: move your camera down in the negative y-direction and to the right along the z-axis. If the camera is orthographic, the amount to move should be
var aspectRatio = (float)Screen.width / Screen.height
new Vector3(camera.orthographicSize * aspectRatio, -camera.orthographicSize)
The longer answer is: In Unity you never position objects in "a camera view's coordinate system", so a camera doesn't really have an origin point.
All you have is the object's world position and the camera's view frustum. Those are the only factors determining where on the screen an object is drawn.
Yes you can move your camera transform in such a way that the world (0,0,0) is in the top left corner. If you use an orthographic camera, it's easier, with perspective camera it's trickier and the distance from camera becomes a factor too.
Actually since it's 3D there's always a whole line segment in world coordinates on which objects appear in the top left corner. What that line segment is depends on the camera's settings, orientation and position.
Answer by Shadowblitz16 · Feb 26, 2017 at 08:46 PM
I tried you code an it has a ton of syntax errors. please post valid code as an example as it won't help new users otherwise.
Your answer
Follow this Question
Related Questions
Draw on a Plane surface with varying camera positions 1 Answer
Y position of objects in Unity 1 Answer
/hello/how say camera going up if.... 0 Answers
Why does everything render in the scene editor, but not after I build it? 0 Answers
Screen cut off on iPhone 4 when using orthographic camera 1 Answer