开发者

Simulating perspective by rotating an image filled rectangle using 2D transforms

开发者 https://www.devze.com 2023-01-21 03:50 出处:网络
Consider a WPF Rectangle filled with some ImageBrush. Now consider an arbitrary axis through rectangle center. I want to apply a 3D-like rotation around the axis employing only 2D transformations. Bas

Consider a WPF Rectangle filled with some ImageBrush. Now consider an arbitrary axis through rectangle center. I want to apply a 3D-like rotation around the axis employing only 2D transformations. Basically开发者_JAVA技巧, I want to achieve perspective with "closer" edge of rectangle to appear larger than the "far" edge which should be visually smaller.

If I replacedRectangle for a Polygon I could simulate this easily but I am not sure if there is a way to distort the ImageBrush so that a 3D effect is achieved.

If it doesn't make sense to do simulated 3D using only 2D transformation, can somebody please suggest a simple but pure 3D solution?


That kind of effect is not mathematically possible with linear transformation.

http://en.wikipedia.org/wiki/Linear_transformation

0

精彩评论

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