* Sets the camera’s position in "world" space without changing its * orientation. * * The parameters, `x`, `y`, and `z`, are the coordinates where the camera * should be placed. For example, calling `myCamera.setPosition(10, 20, 30)` * places the camera at coordinates `(10, 20, 30)` i
(x, y, z)
| 1350 | * } |
| 1351 | */ |
| 1352 | setPosition(x, y, z) { |
| 1353 | const diffX = x - this.eyeX; |
| 1354 | const diffY = y - this.eyeY; |
| 1355 | const diffZ = z - this.eyeZ; |
| 1356 | |
| 1357 | this.camera( |
| 1358 | x, |
| 1359 | y, |
| 1360 | z, |
| 1361 | this.centerX + diffX, |
| 1362 | this.centerY + diffY, |
| 1363 | this.centerZ + diffZ, |
| 1364 | this.upX, |
| 1365 | this.upY, |
| 1366 | this.upZ |
| 1367 | ); |
| 1368 | } |
| 1369 | |
| 1370 | /** |
| 1371 | * Sets the camera’s position, orientation, and projection by copying another |
no test coverage detected