buffer-geometry

ThreeJS bufferGeometry position attribute not updating when translation applied

梦想的初衷 提交于 2019-12-06 00:25:33
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 myMesh.position myMesh.quaternion Translation is happening in the scene and all works well. I expected that the myMesh.geometry.attributes.position.array would be different before and after the translation - but it remained identical. I want to extract the new veritces from the buffergeometry after translation . I tried to call myMesh.geometry.dynamic = true;

BufferGeometry offsets and indices

独自空忆成欢 提交于 2019-12-05 16:53:48
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 can't currently find it anymore in the dev tree. Although indices seem rather obvious and although I could dive into the code to figure out some maybe-correct answer for myself I'd love to hear an "official" statement :) Thanks! There are two ways to defining geometries: Non-Indexed "vertices": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, ... ], "normals": [ 0, 1, 2, 3

Transforming Geometry to BufferGeometry

时光毁灭记忆、已成空白 提交于 2019-12-03 05:44:10
问题 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 memory compact with less objects? For example if I create a new SphereGeometry, is there a way to easily transform that to a BufferGeometry? 回答1: You are in luck. var bufferGeometry = new THREE.BufferGeometry().fromGeometry( geometry ); EDIT: updated

three.js point clouds, BufferGeometry and incorrect transparency

僤鯓⒐⒋嵵緔 提交于 2019-12-02 06:31:00
问题 The problem: I have a point cloud with quite a lot of data points (around one million). When I apply transparency to the rendered points, the transparency somehow does not show what is behind the rendered points As you can see in the example of the marked point, it does not show what it should, it is as if there is a problem with the buffering. I use three.js to create a point cloud using the following "setup": The renderer: this.renderer = new THREE.WebGLRenderer({ canvas: this.canvas,

three.js point clouds, BufferGeometry and incorrect transparency

假如想象 提交于 2019-12-02 03:45:13
The problem: I have a point cloud with quite a lot of data points (around one million). When I apply transparency to the rendered points, the transparency somehow does not show what is behind the rendered points As you can see in the example of the marked point, it does not show what it should, it is as if there is a problem with the buffering. I use three.js to create a point cloud using the following "setup": The renderer: this.renderer = new THREE.WebGLRenderer({ canvas: this.canvas, antialias: true }); The material: this.pointMaterial = new THREE.ShaderMaterial( { uniforms: { time: { type:

BufferGeometry faces materials

会有一股神秘感。 提交于 2019-12-01 13:41:17
When using BufferGeometry, how can I assign a material to a face ? Is there something like an array containing the same informations that Face#materialIndex ? BufferGeometry doesn't support MeshFaceMaterial . edap This answer is old. It is possible to add multiple materials to a buffer geometry see how do drawcalls work in three.js? 来源: https://stackoverflow.com/questions/15752173/buffergeometry-faces-materials

BufferGeometry faces materials

一个人想着一个人 提交于 2019-12-01 10:09:47
问题 When using BufferGeometry, how can I assign a material to a face ? Is there something like an array containing the same informations that Face#materialIndex ? 回答1: BufferGeometry doesn't support MeshFaceMaterial . 回答2: This answer is old. It is possible to add multiple materials to a buffer geometry see how do drawcalls work in three.js? 来源: https://stackoverflow.com/questions/15752173/buffergeometry-faces-materials