hen Posted January 26, 2016 Share Posted January 26, 2016 I the example below i am trying to morph a skinned character head by modifying its vertices positions. Weird is that this breaks the mesh, even when i apply its original positions. Is that maybe because the mesh is skinned? Or am i missing something? // get the original positions of vertices var vertexData = BABYLON.VertexData.ExtractFromMesh(this.head); var verticesArray = []; var vertices = vertexData.positions; for (var i = 0; i < vertices.length; i+=3) { verticesArray.push(BABYLON.Vector3.FromArray(vertices, i)); } // now... after i modified the positions (in another function) push them to array var positions = []; for (var i = 0; i < vertices.length; i++) { var v = vertices; positions.push(v.x); positions.push(v.y); positions.push(v.z); }; // and apply to the mesh this.head.setVerticesData(BABYLON.VertexBuffer.PositionKind, positions, true); Quote Link to comment Share on other sites More sharing options...
chg Posted January 26, 2016 Share Posted January 26, 2016 I assume: var v = vertices; should be: var v = vertices[ i ]; ? EDIT: nevermind, clearly it was as evidenced by the italised code that follows where it should appear, buggy upgraded forum is buggy Quote Link to comment Share on other sites More sharing options...
hen Posted January 26, 2016 Author Share Posted January 26, 2016 I just solved it.. shame on me, because the problem was in my morph algo. Works fast like any other mesh mod i did, babylon rocks here! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 26, 2016 Share Posted January 26, 2016 3 hours ago, hen said: Works fast like any other mesh mod i did, babylon rocks here! YEAH \o/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.