code: def compute_extrinsic_matrix(
      azimuth: float, elevation: float, distance: float
  ):  # pragma: no cover
      """
      Copied from meshrcnn codebase:
      https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py#L96
  
      Compute 4x4 extrinsic matrix that converts from homogeneous world coordinates
      to homogeneous camera coordinates. We assume that the camera is looking at the
      origin.
      Used in R2N2 Dataset when computing calibration matrices.
  
      Args:
          azimuth: Rotation about the z-axis, in degrees.
          elevation: Rotation above the xy-plane, in degrees.
          distance: Distance from the origin.
  
      Returns:
          FloatTensor of shape (4, 4).
      """
      azimuth, elevation, distance = (
          float(azimuth),
          float(elevation),
          float(distance),
      )
  
      az_rad = -math.pi * azimuth / 180.0
      el_rad = -math.pi * elevation / 180.0
      sa = math.sin(az_rad)
      ca = math.cos(az_rad)
      se = math.sin(el_rad)
      ce = math.cos(el_rad)
      R_world2obj = torch.tensor(
          [
              [ca * ce, sa * ce, -se],
              [-sa, ca, 0],
              [ca * se, sa * se, ce],
          ]
      )
      R_obj2cam = torch.tensor(
          [[0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 0.0, 0.0]]
      )
      R_world2cam = R_obj2cam.mm(R_world2obj)
      cam_location = torch.tensor([[distance, 0, 0]]).t()
      T_world2cam = -(R_obj2cam.mm(cam_location))
      RT = torch.cat([R_world2cam, T_world2cam], dim=1)
      RT = torch.cat([RT, torch.tensor([[0.0, 0, 0, 1]])])
  
      # Georgia: For some reason I cannot fathom, when Blender loads a .obj file it
      # rotates the model 90 degrees about the x axis. To compensate for this quirk we
      # roll that rotation into the extrinsic matrix here
      rot = torch.tensor(
          [[1, 0, 0, 0], [0, 0, -1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
      )
      RT = RT.mm(rot.to(RT))
  
      return RT
  
imports: import math
  from typing import Dict, List
  import numpy
  import torch
  from pytorch3d.common.datatypes import Device
  from pytorch3d.datasets.utils import collate_batched_meshes
  from pytorch3d.ops import cubify
  from pytorch3d.renderer import HardPhongShader, MeshRasterizer, MeshRenderer, PointLights, RasterizationSettings, TexturesVertex
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.transforms import Transform3d
label_desc: Use image node_id 2 for calling a global function with example usage: compute_extrinsic_matrix(azimuth, elevation, distance) and returns: RT