I need to get the ratio of how much the viewport camera looks at the object perpendicular to the Z axis?
For example, there is a cube and the user rotates the camera. when you align it with the Z axis, the cube will change its transparency. How do I calculate how much the camera is perpendicular to the cube on the Z axis?
We have camera and object matrices:
camera = context.region_data.view_matrix
obj = context.active_object