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

flip a/b in the project code #96

Open
Pomax opened this issue May 31, 2024 · 0 comments
Open

flip a/b in the project code #96

Pomax opened this issue May 31, 2024 · 0 comments

Comments

@Pomax
Copy link
Owner

Pomax commented May 31, 2024

It'll be a major version update, but I really want X to run left/right and Y front-back, not the other way around.

class CabinetProjector {
  ...

  rotate(x, y, z) {
    let { A, B, C } = this;

    let a = x;
    let b = y * cos(A) - z * sin(A);
    let c = y * sin(A) + z * cos(A);

    x = a;
    y = b;
    z = c;

    a = x * cos(B) + z * sin(B);
    b = y;
    c = x * -sin(B) + z * cos(B);

    x = a;
    y = b;
    z = c;

    a = x * cos(C) - y * sin(C);
    b = x * sin(C) + y * cos(C);
    c = z;

    return [b, a, c];
  }

  ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant