Canvas Surface Rotation
Original and explanation here:
source from microsoft
ref 1
ref 2
How To Create 3D Graphics Using Canvas
How to map points between 2D coordinate systems
How to Use Canvas to Create a Space Game
Instructions:
The z-axis extends out from the center of the screen
--- To rotate about the x-axis, press the up/down arrow keys.
--- To rotate about the y-axis, press the left/right arrow keys.
--- To rotate about the z-axis, press the ctrl+left/ctrl+down arrow keys.
Note that pressing an arrow key down continuously will not rotate the surface.
The surface is rotated once per key press.
The image below contain 8100 evenly spaced (x, y) points from the xy-plane were used to calculate the height z of the surface above the xy-plane using the given equation ƒ(x, y). Stated another way, each surface point (x, y, z) in the xyz-coordinate system is given by (x, y, ƒ(x, y)).