Cycles: Make transform from viewplane a generic utility function
This commit is contained in:
@@ -46,9 +46,11 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "util_math.h"
|
||||
#include "util_transform.h"
|
||||
|
||||
#include "util_boundbox.h"
|
||||
#include "util_math.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Transform Inverse */
|
||||
@@ -271,5 +273,15 @@ void transform_motion_decompose(DecompMotionTransform *decomp, const MotionTrans
|
||||
decomp->post_y = post.y;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
Transform 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
|
||||
|
||||
Reference in New Issue
Block a user