JohnK Posted April 24, 2015 Share Posted April 24, 2015 Just started to use babylon.js and am enjoying its potential. I have successfully created a curved by adjoining a sequence of points as incurve = BABYLON.Mesh.CreateLines("curve", path, scene, true);and adjusted points on the path and updated the curve usingcurve = BABYLON.Mesh.CreateLines(null, path, null, null, curve);However when I add new points to the path updating the curve using the above code does not give the correct new curve. Usingcurve = BABYLON.Mesh.CreateLines("curve", path, scene, true);once again draws the correct new curve but leaves behind the original curve. Is there a method of adding points to a path and to update the curve? How do you delete an existing mesh in a scene? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 24, 2015 Share Posted April 24, 2015 Hello and welcome! You cannot add nor remove elements this way. You have to create a brand new curve (meaning without referencing the previous one with the latest parameter) Under the hood, this is because we can easily update the underlying vertex buffer but we need to create a new one if we have to change its size JohnK 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted April 25, 2015 Share Posted April 25, 2015 http://doc.babylonjs.com/page.php?p=25096 Maybe is it missing in the doc the fact that only the point positions can be updated, not the point number. dispose() will delete the mesh JohnK 1 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.