Last active
March 1, 2021 23:27
-
-
Save BABAK0T0/005479fbd90f7dd5e236a0f6f04e11b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create an empty BufferGeometry | |
| const geometry = new THREE.BufferGeometry() | |
| // Create a Float32Array containing the vertices position (3 by 3) | |
| const positionsArray = new Float32Array([ | |
| 0, 0, 0, // First vertex | |
| 0, 1, 0, // Second vertex | |
| 1, 0, 0 // Third vertex | |
| ]) | |
| // Create the attribute and name it 'position' | |
| const positionsAttribute = new THREE.BufferAttribute(positionsArray, 3) | |
| geometry.setAttribute('position', positionsAttribute) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment