Skip to content

Vertices and verticesNeedUpdate errors in Three.js r125 #43

Open
@subvertallchris

Description

@subvertallchris

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions