diff --git a/app/node/distort/transform/transform.cpp b/app/node/distort/transform/transform.cpp index 94392dc2d..f200b9add 100644 --- a/app/node/distort/transform/transform.cpp +++ b/app/node/distort/transform/transform.cpp @@ -95,6 +95,9 @@ QVariant TransformDistort::Value(NodeOutput *output, const rational &time) // Scale mat.scale(scale_input_->get_value(time).value()*0.01f); + // Anchor Point + mat.translate(anchor_input_->get_value(time).value() * 0.01f); + return mat; } diff --git a/app/node/input/media/media.cpp b/app/node/input/media/media.cpp index 004da2617..4bedce46b 100644 --- a/app/node/input/media/media.cpp +++ b/app/node/input/media/media.cpp @@ -233,8 +233,21 @@ QVariant MediaInput::Value(NodeOutput *output, const rational &time) // Draw with the internal texture internal_tex_.Bind(); + QMatrix4x4 transform; + + float sequence_aspect_ratio = static_cast(renderer->width()) / static_cast(renderer->height()); + float media_aspect_ratio = static_cast(frame_->width()) / static_cast(frame_->height()); + + transform.scale(1.0f / sequence_aspect_ratio, 1.0f); + + // Input transform + transform *= matrix_input_->get_value(time).value(); + + transform.scale(media_aspect_ratio, 1.0f); + /*transform.scale(static_cast(frame_->width()) / static_cast(renderer->width()), + static_cast(frame_->height()) / static_cast(renderer->height()));*/ + // Use pipeline to blit using transformation matrix from input - QMatrix4x4 transform = matrix_input_->get_value(time).value(); if (renderer->mode() == olive::RenderMode::kOffline) { olive::gl::OCIOBlit(pipeline_, ocio_texture_, false, transform); } else {