Is the "attributes" property found in the PlaneGeometry object a new feature (after r124)?

@prisoner849 gave me a killer CodePen that shows how to do a great looking laser scan. Here’s the forum thread that talks about it:

I just integrated the code into my ThreeJS scene. There is this bit of code in the example that access the attributes property of a PlaneGeometry object:

let g = new THREE.PlaneGeometry(1, 1, 72, 20);
let pos = g.attributes.position;
let uv = g.attributes.uv;

This code works fine in the CodePen. However when I run it in my code, the attributes property is null. Is the attributes property a new feature that was added after r124, the version I’m using?

If so, is there some way for me to accomplish the same thing with my r124 build? If not, what do you think my success chances are of transplanting the PlaneGeometry object from the latest version of ThreeJ into a r124 build?

It should work if you use PlaneBufferGeometry.

All geometry generators like PlaneGeometry are derived from BufferGeometry since r125 (because Geometry has been removed). So if you upgrade one release, the mentioned error should go away, too.

2 Likes