admin管理员组文章数量:1124803
I'm trying to create a text effect like in the iconic Star Wars opening sequence using Skia (or SkiaSharp, but that doesn't matter).
Using the following code I can get the text to appear tilted backwards:
// Center of canvas
var xCenter = 1280.0f / 2;
var yCenter = 720.0f / 2;
// Translate center to origin
var matrix = SKMatrix44.CreateIdentity();
matrix = matrix.PreConcat(SKMatrix44.CreateTranslation(-xCenter, -yCenter,0));
matrix = matrix.PostConcat(SKMatrix44.CreateRotationDegrees(1, 0, 0, 45f));
// TODO Perspective transformation
// Translate back to center
matrix = matrix.PostConcat(SKMatrix44.CreateTranslation(xCenter, yCenter, 0));
// Set the matrix
canvas.Concat(matrix);
But the perspective distortion (the text gets smaller “towards the back”) doesn't work for me.
本文标签: cSkia perspective matrix transformationStack Overflow
版权声明:本文标题:c# - Skia perspective matrix transformation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736646605a1946121.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论