ovmihai Posted January 15, 2016 Share Posted January 15, 2016 Hello guys, Is there any options to merge lines in on mesh? I saw that there is a function MergeMeshes and it works great but for lines? Thank you Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 15, 2016 Share Posted January 15, 2016 I tried to merge the lines and I received an error. I do not think that the lines can be merged for now or it may be a bug. Quote Link to comment Share on other sites More sharing options...
jerome Posted January 15, 2016 Share Posted January 15, 2016 AFAIK only meshes can be merged But I've in mind to implement a Line System (morphable of course), in which the user will be able to merge lines, make grids, etc, etc Dad72 and RaananW 2 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 15, 2016 Share Posted January 15, 2016 cool Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 15, 2016 Share Posted January 15, 2016 A wonderful question for the new Q&A sub category Quote Link to comment Share on other sites More sharing options...
ovmihai Posted January 22, 2016 Author Share Posted January 22, 2016 So..is there any option to reduce the number of lines when drawing a ruler ? (See attached image) Thank you. Quote Link to comment Share on other sites More sharing options...
jerome Posted January 22, 2016 Share Posted January 22, 2016 not for now... I think I will start the Line System for the BJS v2.4 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 10, 2016 Share Posted November 10, 2016 @jerome I come to take news about this new feature that you wanted to do. Is it available in 2.5 ? Thanks Jerome Quote Link to comment Share on other sites More sharing options...
jerome Posted November 11, 2016 Share Posted November 11, 2016 yes it is : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#linesystem Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 11, 2016 Share Posted November 11, 2016 Cool, thanks Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 11, 2016 Share Posted November 11, 2016 I can not create a grid. I'm not sure how to do it. for (var i1 =-50; i1 <= 50; i1++) { this.lines.push(new BABYLON.Vector3(i1, 0, -50)); this.lines.push(new BABYLON.Vector3(i1, 0, 50)); } for (var i2 =-50; i2 <= 50; i2++) { this.lines.push(new BABYLON.Vector3(-50, 0, i2)); this.lines.push(new BABYLON.Vector3(50, 0, i2)); } var lineSystem = BABYLON.MeshBuilder.CreateLineSystem("lineSystem", {lines: this.lines}, global.scene); lineSystem = BABYLON.MeshBuilder.CreateLineSystem(null, {lines: this.lines, instance: lineSystem}); Previously I made it work like this: http://www.babylonjs-playground.com/#2K1IS4#11 Thanks Jerome Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 11, 2016 Share Posted November 11, 2016 Ok, I understood the operation: var _lines = []; for (var i1 =-50; i1 <= 50; i1++) { _lines.push([new BABYLON.Vector3(i1, 0, -50), new BABYLON.Vector3(i1, 0, 50)]); } for (var i2 =-50; i2 <= 50; i2++) { _lines.push([new BABYLON.Vector3(-50, 0, i2), new BABYLON.Vector3(50, 0, i2)]); } var lineSystem = BABYLON.MeshBuilder.CreateLineSystem("lineSystem", {lines: _lines}, scene); lineSystem = BABYLON.MeshBuilder.CreateLineSystem(null, {lines: _lines, instance: lineSystem}); lineSystem.isPickable = false; Works perfectly well. This feature is great. Demo: http://www.babylonjs-playground.com/#2K1IS4#12 jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted November 11, 2016 Share Posted November 11, 2016 you can search also the PG serach engine with "LineSystem", there should be many working examples about your example, you don't need to call CreateLineSystem() twice : http://www.babylonjs-playground.com/#2K1IS4#13 the second call is needed only if you want to morph (dynamically update) the existing line system 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.