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

Vertices and verticesNeedUpdate errors in Three.js r125 #43

Open
subvertallchris opened this issue Mar 30, 2021 · 0 comments
Open

Vertices and verticesNeedUpdate errors in Three.js r125 #43

subvertallchris opened this issue Mar 30, 2021 · 0 comments

Comments

@subvertallchris
Copy link

Three.js r125 introduces some breaking changes to BufferGeometry. In particular, these lines will have trouble. I'm unsure about the rest of the repo.

I created a post on StackOverflow here asking for help with this and an answer came in quickly. Tldr; you could fix those lines with something like this:

    const negativeWidth = -this.canvas.width / 2;
    const positiveWidth = this.canvas.width / 2;
    const positiveHeight = this.canvas.height / 2;
    const negativeHeight = -this.canvas.height / 2;

    this.geometry.attributes.position.setXY(0, negativeWidth, positiveHeight);
    this.geometry.attributes.position.setXY(1, positiveWidth, positiveHeight);
    this.geometry.attributes.position.setXY(2, negativeWidth, negativeHeight);
    this.geometry.attributes.position.setXY(3, positiveWidth, negativeHeight);
    this.geometry.attributes.position.needsUpdate = true;

I'm not going to submit a PR here because I'm unsure of how this would impact earlier versions and I'm not prepared to find out but I wanted to share in case anyone else wants to give it a shot.

@subvertallchris subvertallchris changed the title Vertices and updateVertices errors in Three.js r125 Vertices and verticesNeedUpdate errors in Three.js r125 Mar 30, 2021
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