Re-add rotateY function
This commit is contained in:
1 parent
5bbb16496e
commit
9253f4faf6
1 file changed
+6
@@ -67,6 +67,12 @@
|
|||||||
|
|
||||||
const camera = { fov: 800 };
|
const camera = { fov: 800 };
|
||||||
|
|
||||||
|
function rotateY(p, angle) {
|
||||||
|
const cos = Math.cos(angle);
|
||||||
|
const sin = Math.sin(angle);
|
||||||
|
return { x: p.x * cos - p.z * sin, y: p.y, z: p.x * sin + p.z * cos };
|
||||||
|
}
|
||||||
|
|
||||||
class Point3D {
|
class Point3D {
|
||||||
constructor(x, y, z) {
|
constructor(x, y, z) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
|||||||
Reference in new issue
Block a user