开发者

Direct2D (C#), how to use transformation matrices?

开发者 https://www.devze.com 2022-12-24 19:56 出处:网络
I\'m using Direct2D in C#, and I\'ve seen some examples on MSDN (in C++), that use operator * to multiply matr开发者_JAVA技巧ices (Matrix3x2F). However, in C#, not only is operator* not overloaded, bu

I'm using Direct2D in C#, and I've seen some examples on MSDN (in C++), that use operator * to multiply matr开发者_JAVA技巧ices (Matrix3x2F). However, in C#, not only is operator* not overloaded, but there's no method that allows me to do this, so I can't "accumulate transformations". Am I missing something? Are there any helper methods for this? I've tried writing my own, but failed...


What wrapper are you using for C#, usually you'd use either C# or SlimDX however both have multiply overloaded for matrices. If whatever you're using doesn't have these two can switch to one that does or write your own. It's not too hard to write your own, it's simply each row multiplied by each column for each cell. http://en.wikipedia.org/wiki/Matrix_multiplication can give a more detailed example.

0

精彩评论

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

关注公众号