You are given a rectangle with width, x a开发者_如何学JAVAnd height y. You can see that first of all the rectangle rotates from the middle along the y-axis. Once the rotation is complete, it rotates along the x-axis but from the bottom.
Consider yourself to be in a 2D drawing space, as a result, you cannot use 3D transformation matrices to perform these tasks.
Generally you would use homographic coordinate vectors to describe your rectangle by appending a 1 for z to your 2D coordinates. This lets you use 3d transformation matrixes as appropriate.
Your constraint seems pointless- if the problem is data storage, simulate the appended 1 by calculating the matrix transformation with a function instead of a simple matrix multiplication.
http://en.wikipedia.org/wiki/Homography
精彩评论