Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax error re: new p5.Vector.cross #6640

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/webgl/p5.Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -2110,9 +2110,9 @@ p5.Camera = class Camera {
// up vector. normalized camera's up vector.
const up = new p5.Vector(this.upX, this.upY, this.upZ).normalize(); // y-axis
// side vector. Right when viewed from the front
const side = new p5.Vector.cross(up, front).normalize(); // x-axis
const side = p5.Vector.cross(up, front).normalize(); // x-axis
// vertical vector. normalized vector of projection of front vector.
const vertical = new p5.Vector.cross(side, up); // z-axis
const vertical = p5.Vector.cross(side, up); // z-axis

// update camRadius
camRadius *= Math.pow(10, dRadius);
Expand Down Expand Up @@ -2180,9 +2180,9 @@ p5.Camera = class Camera {
// up vector. camera's up vector.
const up = new p5.Vector(this.upX, this.upY, this.upZ);
// side vector. Right when viewed from the front. (like x-axis)
const side = new p5.Vector.cross(up, front).normalize();
const side = p5.Vector.cross(up, front).normalize();
// down vector. Bottom when viewed from the front. (like y-axis)
const down = new p5.Vector.cross(front, side);
const down = p5.Vector.cross(front, side);

// side vector and down vector are no longer used as-is.
// Create a vector representing the direction of rotation
Expand All @@ -2195,7 +2195,7 @@ p5.Camera = class Camera {
const rotAngle = Math.sqrt(dx*dx + dy*dy);
// The vector that is orthogonal to both the front vector and
// the rotation direction vector is the rotation axis vector.
const axis = new p5.Vector.cross(front, side);
const axis = p5.Vector.cross(front, side);

// update camRadius
camRadius *= Math.pow(10, dRadius);
Expand Down
Loading