45 if (m_width == 0 || m_height == 0) {
49 PT(MatrixLens) lens =
new MatrixLens();
50 const double A = (m_clipFar + m_clipNear) / (m_clipFar - m_clipNear);
51 const double B = -2.0 * (m_clipFar * m_clipNear) / (m_clipFar - m_clipNear);
53 const double cx = m_cam.get_u0();
54 const double cy = m_height - m_cam.get_v0();
56 lens->set_near_far(m_clipNear, m_clipFar);
57 lens->set_user_mat(LMatrix4(
58 m_cam.get_px(), 0, 0, 0,
60 0, m_cam.get_py(), 0, 0,
63 lens->set_film_size(m_width, m_height);
64 lens->set_film_offset(m_width * 0.5 - cx, m_height * 0.5 - cy);
65 camera->set_lens(lens);