The role of the Three.js camera.up parameter

There are three parameters in camera, position, lookAt, up.

position, set the position of the camera. That is, where to put the camera.

lookAt, set the position where the camera looks at, that is, where the camera looks at at the position. If position is set to (500,500,500), lookAt is set to (100,100,100). It means to put the camera at the coordinates of (500,500,500), and point the camera at the position of (100,100,100) to look over.

up. is the positive direction of the camera. Assuming that the human eye is a camera, then the positive direction of the camera is from the mouth --> eyes --> the direction of the top of the head is the positive direction. Then if up is set to (1,0,0), it means that the positive direction of the camera (mouth --> eyes --> the direction of the top of the head) is parallel to the positive direction of the X axis.

If up is (-1,0,0), it is parallel to the negative half axis of the X axis. Similarly, the yz axes are consistent.

As some bloggers said, the up value determines whether you are lying down, standing or standing upside down

Guess you like

Origin blog.csdn.net/QiZi_Zpl/article/details/102740028