开发者

2D Graphics Transform - moving the origin

开发者 https://www.devze.com 2023-03-11 03:32 出处:网络
I have a vector graphics format that has its origin at the bottom left and i need to render it to an enh开发者_运维知识库anced metafile which has its origin at the top left. What is a transform to mov

I have a vector graphics format that has its origin at the bottom left and i need to render it to an enh开发者_运维知识库anced metafile which has its origin at the top left. What is a transform to move between the two without flipping it upside down?


I may have misunderstood your question completely, but here goes: Create a vector from the old origin to the new origin (a vector pointing upwards) and subtract that from all points in the file.

If you want to do this as a transform, you need a 3 by 3 matrix like the following:

1 0 0

0 1 -T

0 0 1

Where "T" is the translation required from top to bottom..

hope thats usefull to you...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号