-
Notifications
You must be signed in to change notification settings - Fork 1
ViewSettings
The defaultCamOrientation specifies the orientation of the cube when cubeRx=0, cubeRy=0 and cubeRz=0 (which are rotations of the cube) are all zero.
As discussed in the other pages, The world coordinate frame has the yellow point as the origin, the yellow axis is the z axis, the red axis is the y axis and the blue axis is the y axis, and dataZoffset=1 (the pyramid).
defaultCamOrientation="z-forward-x-left" |
``defaultCamOrientation="z-up-x-left"` |
|---|---|
![]() |
![]() |
defaultCamOrientation="z-up-x-forward" |
defaultCamOrientation=z-forward-x-right |
|---|---|
![]() |
![]() |
To better understand the cam.zoom and canvasToViewRatio I'm going to borrow some images from the following:
-
Scratch a Pixel 2.0: Finding the 2D pixel coordinates of a 3D Point Explained from Beginning to End
-
Gabriel Gambeta: Computer Graphics from scratch (Perspective Projection)
Bottomline if you increase the cam.zoom or canvasToViewRatio everything will appear bigger. If you decrease them, they will appear smaller.
-
defaultCamZoffsetis the distance of the camera coordinate frame from the world coordinate frame origin whencamTz=0in thezAxisdirection of the world coordinate frame. -
camTxis the distance of the camera from the world coordinate frame origin in thexAxisdirection of the world coordinate frame. -
camTyis the distance of the camera from the world coordinate from origin in theyAxisdirection of the world coordinate frame.
The world coordinate frame has the yellow point as the origin. cubeRx, cubeRy, and cubeRz are angles in degrees for which the cube is rotated where the turning point is the origin of the coordinate frame. In the picture below cubeRx=0, cubeRy=27.5, cubeRz=0 which is wrt to the origin of the world coordinate frame.
If you want the cube to rotate with respect to the center of the floor of the cube. Make the cubeZoffset=1
In the picture below Rx=-25, Ry=0 Rz=-25.8 which is wrt to the origin of the world coordinate frame.



