Cycles: Make transform from viewplane a generic utility function

This commit is contained in:
Sergey Sharybin
2015-04-10 15:52:40 +05:00
parent 237c53fbf1
commit e073562f80
4 changed files with 17 additions and 14 deletions

View File

@@ -409,15 +409,4 @@ BoundBox Camera::viewplane_bounds_get()
return bounds;
}
Transform Camera::transform_from_viewplane(BoundBox2D &viewplane)
{
return
transform_scale(1.0f / (viewplane.right - viewplane.left),
1.0f / (viewplane.top - viewplane.bottom),
1.0f) *
transform_translate(-viewplane.left,
-viewplane.bottom,
0.0f);
}
CCL_NAMESPACE_END