# how to get camera exactly like in the z perspective view [duplicate]

I'm making a text animation,in which in the end i want the camera to look exactly like when i look through the Z perspective view(numpad 7), so that the text seems 2d in the end. how do i make the camera do this?

Top view for camera has no translation or rotation.

See.

Align camera to view precisely and automatically, without manual fiddling

How to convert current view as camera?

Oops, realized after making gif q asked for perspective rather than ortho. ie don't change to ortho, however ortho is IMO may be a better way to make text look 2D.

In the cameras property boxes, can clear both location and rotation, to have the camera facing downwards.

AltG Object > Clear > Clear Location

AltR Object > Clear > Clear Rotation

Then move up in $$z$$ and set camera type to perespective

Here is a script to do this, moving the camera to 2 bu directly above origin.

import bpy

context = bpy.context
scene = context.scene
cam = scene.camera

cam.matrix_world.identity()
cam.data.type = 'PERSP'
cam.matrix_world.translation.z = 2