sQuid Posted January 20, 2014 Share Posted January 20, 2014 Hi - I have an annoying bug in a simple graph visualization tool that can be seen here. What happens is that sometimes, when changing the displayed lattice, a subset of the edges are displaced. If you look at the link, for example, switching from Diamond(3) to the Diamond(2) shows the misplaced edges. However if you switch to Diamond(2) from any of the other examples everything is fine. I *think* I haven't properly taken care of parent relationships when disposing of meshes, but can't figure out what I missed, and why it only happens for certain subsets when switching between graphs. The offending code can be found at http://www.ntpic.net/glattice/Glattice.js. Edges in the graphs are simple cylinders, whose parents are set to be the appropriate source vertex so they can be oriented and scaled in local coordinates.var _edge = me.edges[ii];_edge.parent = me.vertices[ee[1]];When switching from a larger graph to a smaller one, the excess vertices and edges are disposed of e.g.if (data.edge.length < nedges){ me.edges.splice(data.edge.length, 1+nedges-data.edge.length).forEach(function(e) {e.dispose();}); nedges = me.edges.length;} and then the remaining edges and vertices are transformed into the correct positions. Apart from certain cases like the one mentioned above. If anyone has any tips they would me much appreciated. thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 20, 2014 Share Posted January 20, 2014 Hello, could you try with babylon 1.8.5 because we fixed a bug with parent removal in this specific version. If it does not fix your problem, let me know Quote Link to comment Share on other sites More sharing options...
sQuid Posted January 21, 2014 Author Share Posted January 21, 2014 Yes that fixed it, thanks very much! Awesome platform btw. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 22, 2014 Share Posted January 22, 2014 Thanks 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.