Hartha Posted March 28, 2017 Share Posted March 28, 2017 Hello, I'm trying to create a line [ linesMesh] with only tow points and change it's length dynamically or change the second point position, is there any way to do that ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 28, 2017 Share Posted March 28, 2017 Looks like Babylon.LineMesh stores its vertices just like any other mesh, so mesh.updateVerticesData() should work. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 28, 2017 Share Posted March 28, 2017 Just re-use the function MeshBuilder.CreateLines() with the parameter "instance" : http://doc.babylonjs.com/tutorials/mesh_createxxx_methods_with_options_parameter#lines Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 28, 2017 Share Posted March 28, 2017 As the ops issue looks solved by @jerome, I have a couple of questions on why a line system was implemented this way. The business end of loading is done by VertexData.CreateLineSystem. I was wondering do indices really need to be loaded? I thought it was made optional at some point. Since there is no vertex duplication, it would be a good candidate. I have been looking at ways to port Blender particle / stranded hair. I would need about 25,000, 6 segment lines. Even though indices are calculated instead of passed, I would like to know If I could side-step the potential bit 16 int issue on old hardware by not using them? Any implementation could have a fairly complex representation (relative positioning to the last segment) to reduce file size. So, would probably try to instance a LineMesh directly, once unpacked. I am not sure went I plan to attempt this, but does it look something like this would have to be the only thing in a scene to even work? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 28, 2017 Share Posted March 28, 2017 Also, can a LineMesh have an armature? A character could look left / right. The hair would not have to "fly", but the roots still be on the head in the same place. If not, will have to make a custom Mesh class, and abandon LineMesh as an alternative. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 28, 2017 Share Posted March 28, 2017 Actually a line system can render many lines at once, or lines and segments, or plenty of different things that would be displayed with no surface. So indices are needed. It's on my todo list to add the line and line system per vertex color... so one render call to display several differently colored lines/segments JCPalmer 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.