Hello everyone!
I’m trying to project points on the meshes with rectangular bufferGeometry
const { width, height } = this.size
const vertices = new Float32Array([
-width / 2, 0, 0,
-width / 2, height, 0,
width / 2, height, 0,
width / 2, 0, 0,
])
this.geometry.setIndex([
0, 1, 2,
0, 2, 3
])
this.geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3))
const { width, depth } = this.size
const vertices = new Float32Array([
-width / 2, 0, -depth / 2,
-width / 2, 0, depth / 2,
width / 2, 0, depth / 2,
width / 2, 0, -depth / 2
])
this.geometry.setIndex([
0, 1, 2,
0, 2, 3
])
this.geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3))
The approximate result that i want are shown on the images
full demo here (Can’t import OrbitControls in sandbox for some reason)
How can I achieve the result?
Thank you!