MCPcopy Create free account
hub / github.com/colmap/colmap / ComposeProjectionMatrix

Method ComposeProjectionMatrix

src/colmap/ui/model_viewer_widget.cc:1619–1635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1617}
1618
1619void ModelViewerWidget::ComposeProjectionMatrix() {
1620 projection_matrix_.setToIdentity();
1621 if (options_->render->projection_type ==
1622 RenderOptions::ProjectionType::PERSPECTIVE) {
1623 projection_matrix_.perspective(
1624 kFieldOfView, AspectRatio(), near_plane_, kFarPlane);
1625 } else if (options_->render->projection_type ==
1626 RenderOptions::ProjectionType::ORTHOGRAPHIC) {
1627 const float extent = OrthographicWindowExtent();
1628 projection_matrix_.ortho(-AspectRatio() * extent,
1629 AspectRatio() * extent,
1630 -extent,
1631 extent,
1632 near_plane_,
1633 kFarPlane);
1634 }
1635}
1636
1637float ModelViewerWidget::ZoomScale() const {
1638 // "Constant" scale factor w.r.t. zoom-level.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected