sparkbuzz Posted July 16, 2015 Share Posted July 16, 2015 Is there a way to merge an array of LineMeshes? I have the following playground sample: http://www.babylonjs-playground.com/#1DSDHD which renders a grid, but looking at the debug overlay, we can see this creates 11 meshes with 2 vertices each. Is it possible to merge these with BABYLON.Mesh.MergeMeshes? I tried this here: http://www.babylonjs-playground.com/#EDMD1#1 but clearly this doesn't work as well. I'd like my line meshes to belong to a single mesh object. Quote Link to comment Share on other sites More sharing options...
jahow Posted July 17, 2015 Share Posted July 17, 2015 Hi, I don't think there's an easy way to do that: line meshes are drawn as one single stroke. You can have as many points in your stroke as you want though, so if you're looking to do a grid with this you can probably find a way to draw the whole grid without "lifting the pen" Quote Link to comment Share on other sites More sharing options...
jerome Posted July 17, 2015 Share Posted July 17, 2015 good idea ! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 17, 2015 Share Posted July 17, 2015 He wants some of his lines to be triple thickness. http://www.html5gamedevs.com/topic/15733-giving-some-thickness-to-linemesh/ Majors? Is that what they call thicker-than-normal lines on a grid? Major grads and minor grads? *shrug* (yawn) LinesGridMaker v1.0 I would say Babylon.Mesh.CreateGrid() but... it's not quite right for that. Grid.getVertexData() would flop like a Sammy Girardin ragdoll. I like to use a PICTURE of a grid... with alpha. That way you can paint pretty vines and flowers... on the grid lines... some little people entangled in the wires... grass and squirrels, etc. sigh. Quote Link to comment Share on other sites More sharing options...
jerome Posted July 17, 2015 Share Posted July 17, 2015 wellbuilding a mesh with many different independant lines shouldn't be that complex imho I need to think about this... a bit like I did for the SPS Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 7, 2015 Share Posted September 7, 2015 Long think. We got the new edgesRenderer now... thx DK. http://www.html5gamedevs.com/topic/16946-edgesrenderer I wonder if edges rendering works on Lines mesh. Sparkbuzz has a related thread going... http://www.html5gamedevs.com/topic/15733-giving-some-thickness-to-linemesh/ Dad72 and Elkyu pondered this, too, as we can see. Jahow made a cool PG demo in that thread (I de-zoomed the camera a bit and re-saved the PG, but he is the author.) He has made certain lines wider... somehow... I haven't really studied it yet. I think he SCALED certain lines to make them thicker/major. See? That's why he gets the big money. Deltakosh has done that, too, many times, at least for me. I'll think-up some huge 40-code-line thing to accomplish something fancy... and then he'll say something like..."Or you COULD just change this value and that value." and he gets my 40 lines done in 2 lines. *sigh*. And then worse than all this... I'll forget about that cool trick in about 2 days. Gettin' old. Brain fail. ANYway... yep, somebody should try the edgeRenderer on Lines mesh. Jahow's method just doesn't burn enough code lines, it's not complicated enough, and it doesn't reduce performance properly. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 7, 2015 Share Posted September 7, 2015 Aarfff...Ok, here is my BJS backlog for now : - reimplement the cylinder without ribbon- check tube and lathe caps (low priority)- implement cuboid as the first extensible mesh type (with param object)- add regular polyhedrons as new mesh types- port the SPS into BJS- add the grid mesh huu.. and I don't speak about my other backlogs here : work, confs, home, etc only 24 h per day on this planet, gasp If someone in this forum could slow down the earth rotation speed please, he would be welcome Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 7, 2015 Share Posted September 7, 2015 Sorry Jerome, I didn't mean to make you feel overloaded. Thanks for sharing your todo list... that all sounds excellent. For those who are new to Jerome's magic... he has created MANY geometry-wrangling toys around here, including parametric shapes like ribbons, tubes, and 3DPath, and he did the fantastic Spherical Harmonics thing, he's done morphing, he's made non-physics-engine cannonball shooters that work great, he writes excellent tutorials and forum posts, on and on, all good. He's a serious hero of mine. I worship the water he walks-on. Thanks Jerome! And look at his face... https://avatars0.githubusercontent.com/u/11529 !! George Clooney, eat your heart out! If the French film industry doesn't somehow utilize this power-asset, then they're just nuts. Sure, we might lose him as our local geometry God for a while, but he'll soon be rich enough as a movie star... to fly us all to Paris for the BJS convention (and his latest movie opening)... and that rocks! jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 7, 2015 Share Posted September 7, 2015 :D ass kissing as I love ! BJS convention would just be huge. I wish I can do all this stuff quickly, especially the polyhedron and SPS part what are exciting (to me, at least). I need to reimplement the cylinder because the cylinder is a fixed mesh, not a parametric one like the tube or the ribbon, and I really want it to have perfect normals everywhere.Perfect normals ? wadafack ???Am I suggesting there are somewhere imperfect normals ? Actually, in some very particular cases that are too complex to explain here, the computeNormals() method, our big magic tool used quite everywhere under the hood, computes some normals that appear weird.Don't worry, it happens only on some vertices, among many many, only on mesh edges and you generally can hardly notice them.It's not a bug (threejs does the same), it's just an exotic case in the initial configuration of the vertices that produces this behavior.So I suppose we can tolerate these tiny variations on (unpredictable) parametric shape edges but, as we can avoid them because we know the final shape on fixed mesh types, I would prefer to re-implement the cylinder with no underlying ribbon. Re-doing things is not the fun part, pfffff Wingnut 1 Quote Link to comment Share on other sites More sharing options...
jahow Posted September 8, 2015 Share Posted September 8, 2015 Just to clarify: I ain't gettin' no big money in all this, no mister. Only in my dreams. Keep up the good work guys Wingnut 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 10, 2015 Share Posted September 10, 2015 I love when the backlog reduces that way :...- reimplement the cylinder without ribbon : http://www.html5gamedevs.com/topic/16989-cylinder-re-implementation/- implement cuboid as the first extensible mesh type (with param object) : http://www.html5gamedevs.com/topic/17044-evolution-for-out-of-the-box-meshes-creation/... 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.