Note that there are some explanatory texts on larger screens.

plurals
  1. POThree JS No Visual Update After Manually Editing Geometry
    primarykey
    data
    text
    <p>So I have a Geometry (the scope of this code is THREE.Geometry.prototype) and I am dynamically editing. newData is an object of { faces: [array of face Indexes], vertices: [array of vertice indexes]}. (these arrays maintain the length of the origin face and vertices arrays length and hold the form [null, null, null, "4", "5", null, null... ])</p> <p>Using these arrays, I strip through all the faces and vertices and apply them to 1 of 2 new arrays, effectively splitting all the data into 2 groups. I also update the pointers on the faces! </p> <p>In the end I know I've updated the geometry and it is correct, but the changes I make aren't getting displayed. I've tried .elementsNeedUpdate which causes and error. (no property 'a' of undefined in InitWebGlObjects... I looked there, couldn't see a reference to a)</p> <p>I've tried vertices need update, it does nothing.</p> <p>I've also tried updateCentroids in combination with the previous tool. It does nothing. </p> <p>I've heard of not being able to resize the buffer. What is the buffer and the length of the buffer? The amount of verticies I'm giving to a model?</p> <p>I've seen "You can emulate resizing by pre-allocating larger buffer and then keeping unneeded vertices collapsed / hidden." It sounds like that may be what I'm doing? How can I collapse/ hide a vertice? I haven't seen any references to that.</p> <p>Thanks for your time! </p> <pre><code> var oldVertices = this.vertices var oldFaces = this.faces; var newVertices = [] var newFaces = []; var verticeChanges = []; this.vertices = []; this.faces = []; for(var i in oldVertices){ var curAr = ((newData.vertices[i]) ? (newVertices):(this.vertices)); curAr.push(oldVertices[i]); verticeChanges[i] = curAr.length-1; } for(var i in oldFaces){ var curAr = ((newData.faces[i]) ? (newFaces):(this.faces)); oldFaces[i].a = verticeChanges[oldFaces[i].a]; oldFaces[i].b = verticeChanges[oldFaces[i].b]; oldFaces[i].c = verticeChanges[oldFaces[i].c]; } console.log('Vertices Cut from', oldVertices.length, "to:", newVertices.length, 'and', this.vertices.length); console.log('Faces Cut from', oldFaces.length, "to:", newFaces.length, 'and', this.faces.length); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload