transform effect complete

This commit is contained in:
itsmattkc
2019-09-18 01:28:22 +10:00
parent 036b8caa03
commit d002da8f60
2 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ QVariant TransformDistort::Value(NodeOutput *output, const rational &time)
mat.scale(scale_input_->get_value(time).value<QVector2D>()*0.01f);
// Anchor Point
mat.translate(anchor_input_->get_value(time).value<QVector2D>());
mat.translate(-anchor_input_->get_value(time).value<QVector2D>());
return mat;
}
+7 -5
View File
@@ -246,16 +246,18 @@ QVariant MediaInput::Value(NodeOutput *output, const rational &time)
QMatrix4x4 transform;
// Scale texture to a square for incoming matrix transformation
transform.scale(static_cast<float>(renderer->height()) / static_cast<float>(renderer->width()), 1.0f);
transform.scale(2.0f / static_cast<float>(renderer->width() * renderer->divider()),
2.0f / static_cast<float>(renderer->height() * renderer->divider()));
// Multiply by input transformation
transform *= matrix_input_->get_value(time).value<QMatrix4x4>();
// Scale texture to the media's aspect ratio
transform.scale(static_cast<float>(frame_->width()) / static_cast<float>(frame_->height()), 1.0f);
// Scale texture to the media size
transform.scale(static_cast<float>(frame_->width()), static_cast<float>(frame_->height()));
transform.scale(0.5f, 0.5f);
float media_size = static_cast<float>(frame_->height()) / static_cast<float>(renderer->height() * renderer->divider());
transform.scale(media_size, media_size);
//float media_size = static_cast<float>(frame_->height()) / static_cast<float>(renderer->height() * renderer->divider());
//transform.scale(media_size, media_size);
// Use pipeline to blit using transformation matrix from input
if (renderer->mode() == olive::RenderMode::kOffline) {