How can I get a 2d point from a matrix3d in silverlight?

岁酱吖の 提交于 2019-12-24 14:53:00

问题


I have a Matrix3D object that defines a 2d plane with perspective. (think a large painting that has fallen on the floor, away from you)

How can I get the 2d point that relates to the new location after the translation ?

If the 'painting' was three horizontal stripes then once the 'painting' is transformed those three stripes of equal width are now a trapezoid where the top stripe is smaller than the middle and bottom one.


回答1:


You need to transform a 3D vector of the form (X, Y, 0) using this matrix. Unfortunately, Matrix3D doesn't have an appropriate method, so you'll have to write the matrix-vector multiplication by hand. Anyway, when you do the transform, the new X, Y coordinates will correspond to the transformed position in screen space, and the Z coordinate will be the depth.



来源:https://stackoverflow.com/questions/5017990/how-can-i-get-a-2d-point-from-a-matrix3d-in-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!