Questions tagged [buffer-geometry]

A geometry class used in the WebGL framework Three.js to increase performance.

A buffer geometry is a certain type of geometry in the Three.js library that will increase performance and decrease memory usage because it reduces the cost of passing all this data to the GPU.

The official documentation for THREE.BufferGeometry can be found here

139 questions
28
votes
1 answer

Transforming Geometry to BufferGeometry

As I understand it, Geometry stores a javascript object structure of the vertices and faces and BufferGeometry just stores the raw gl data via Float32Arrays, etc. Is there any way to turn standard Geometry into BufferGeometry, which is a lot more…
Axiverse
  • 1,589
  • 3
  • 14
  • 30
10
votes
1 answer

Three.js - Questions about (the use of) THREE.BufferGeometry

As I understood using buffer geometries will increase performance and decrease memory usage because it reduces the cost of passing all this data to the GPU. And as I understood from @WestLangley his post here: THREE.BufferGeometry is slowly…
Wilt
  • 41,477
  • 12
  • 152
  • 203
6
votes
2 answers

STL exporter for BufferGeometry in THREE.js

I have a number of BufferGeometries, which consist a scene, and their meshes have been transferred to different positions. I was wondering if there is a way to export this scene, from meshes, containing BufferGeometries to STL file. Thank you very…
Hesamoy
  • 301
  • 1
  • 20
5
votes
1 answer

Three.js: Correct way to setIndex / indices for BufferGeometry?

I'm trying to set per-face UV indices in a BufferGeometry. I'm starting with a Geometry. Each face of my geometry has a face.materialIndex corresponding to a UV index. I'm trying to convert this to a BufferGeometry, and then map over the…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
5
votes
2 answers

CSG operations on bufferGeometry

I am currently using the three.js geometry class for creating a shape and then performing multiple CSG operations on that shape. Thus continuously redrawing the shape. This process of performing multiple csg operations is slow, as I am using…
damitj07
  • 2,689
  • 1
  • 21
  • 40
5
votes
2 answers

How to add faces to THREE.BufferGeometry?

I have created programmatically a simple mesh: var CreateSimpleMesh = new function () { var xy = [], maxX = 7, maxY = 10, river = [[0, 5], [0, 4], [1, 3], [2, 2], [3, 2], [4, 1], [5, 1], [6, 0]], grassGeometry =…
5
votes
1 answer

ThreeJS bufferGeometry position attribute not updating when translation applied

I used STLLoader to load an stl onto a threeJS scene returning a BufferGeometry. I then used myMesh.position.set( x,y,z ) myMesh.rotation.setFromQuaternion ( quaternion , 'XYZ'); to translate the geometry. This effectively changes the…
ahmedhosny
  • 1,099
  • 14
  • 25
5
votes
1 answer

Three.js - BinaryLoader vs. BufferGeometry for large meshes?

I'm looking for a most efficient way to load large polygonal meshes (up to 1M triangles) to Three.js. I'm considering either using a THREE.BufferGeometry object or loading with THREE.BinaryLoader. My questions are: Does BinaryLoader.js create a…
Simon
  • 113
  • 1
  • 8
4
votes
2 answers

how to draw polygon in three js using vertices?

I have vertices(x,y,z) of a polygon as input. How can I render a polygon having these vertices in three.js? THREE.Geometry() is removed from three js. how to draw plane polygon with bufferGeometry or any other method ? now when i draw polygon with…
4
votes
2 answers

Threejs: make custom shader match the standard rendering

For performance reasons I need to display hundred of moving tetrahedrons in a scene. There for I use instancedbuffergeometry which requires a custom shader. The scene also contains objects with regular geometry (non-buffer) and some lights (I…
Barden
  • 1,020
  • 1
  • 10
  • 17
4
votes
1 answer

Three.js finding vertices of buffergeometry after .fromGeometry();

How do I find vertices positions of a mesh after I used .fromGeometry(); code? I created a buffergeometry from a geomtery that I used for a mesh. Here is an example. var geom = new THREE.BoxGeometry(1,1,1); var buffgeom = new…
A. I.
  • 127
  • 2
  • 8
4
votes
1 answer

Raycasting against BufferGeometry Line threejs

I'm trying to raycast against a line that is created with BufferGeometry. But it does not seem to support raycasting? When initiating BufferGeometry as shown here raycasting does not work on this object. But when I replace BufferGeometry with…
user3960875
  • 965
  • 1
  • 13
  • 24
4
votes
1 answer

BufferGeometry offsets and indices

I was just wondering for a while now what exactly "offsets" and "indices / index" are. Offsets are e.g. mentioned in https://github.com/mrdoob/three.js/blob/dev/src/core/BufferGeometry.js and indices were mentioned in IndexedGeometry, however I…
Doidel
  • 1,743
  • 1
  • 14
  • 22
4
votes
1 answer

Three.js BufferGeometry vs Geometry for particles

Some particle examples use THREE.BufferGeometry and others use a simply THREE.Geometry. Some lines about pros and cons of every method?
civiltomain
  • 1,136
  • 1
  • 9
  • 27
3
votes
1 answer

THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute unindexBufferGeometry

Would really appreciate some help updating the webgl-wireframes library code to the latest version of threejs. This function causes the following errors Uncaught TypeError: THREE.Geometry is not a constructor THREE.BufferAttribute: .setArray has…
alten
  • 63
  • 6
1
2 3
9 10