SvenFrankson Posted February 26, 2017 Share Posted February 26, 2017 Hi, You may try here my attempt with BabylonJS, a Lego building app. It's not mobile compatible, as it requires a mouse cursor to preview bricks. It's on the roadmap ! Full project is available here : https://github.com/SvenFrankson/babylon-demo A questions for the helpful BabylonJS veterans : Is there an "easy way" to collect VertexData from Blender models ? I could not find any, so I wrote a JSON Unity exporter (sources here), but I guess I'm not the first one looking for this kind of behaviour in a BabylonJS app... Thanks in advance ! Have a nice day, Sven Frankson Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 Hello, great job! Question where do you get the brick's models from? LDraw? SvenFrankson 1 Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted February 28, 2017 Author Share Posted February 28, 2017 Hi Nockawa, Most bricks are generated with the methods from this script : https://github.com/SvenFrankson/babylon-demo/blob/master/scripts/Meshes.ts Given a size (length, width, height), CubicalData and SlideData generate the vertices to return the appropriate VertexData structure, which is then applied to the mesh. The other bricks (flames, corners, barrels) were made using Blender. Have a nice day ! Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 Take a look at this, I have a whole project that read/convert ldraw parts to BJS's mesh in order to render LDraw models in babylon. If you need the code, I'll be happy to share it. SvenFrankson 1 Quote Link to comment Share on other sites More sharing options...
PhasedEvolution Posted February 28, 2017 Share Posted February 28, 2017 It is really cool! Great job SvenFrankson 1 Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted February 28, 2017 Author Share Posted February 28, 2017 3 hours ago, Nockawa said: Take a look at this, I have a whole project that read/convert ldraw parts to BJS's mesh in order to render LDraw models in babylon. If you need the code, I'll be happy to share it. Nice, I did not know there was some "Lego Standard" for this kind of project... As mine is just a practice demo with BabylonJS, I'm not sure I'll go through the troubles of LDraw-interoperability. Keeping with the simple json strings to store the bricks should be enough. Thanks ! Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 1 minute ago, SvenFrankson said: Nice, I did not know there was some "Lego Standard" for this kind of project... As mine is just some practice demo with BabylonJS, I'm not sure I'll go through the troubles of LDraw-interoperability. Just keeping with the simple json strings to store the bricks should be enough. Thanks ! It's not about interop, it's about if you want all the Lego parts (there's hundred of them) that exists to display them, it's the best way to do so. Now you can do it yourself, but converting a ldraw file of a given part to a json file containing everything to create the mesh is something I already did, so if you change your mind, I'll share the source code. What you've done is great, the way to pile up the part is great, but just for your info, there's already "officials" parts, colors, decals that exists. SvenFrankson 1 Quote Link to comment Share on other sites More sharing options...
Oliver77 Posted March 2, 2017 Share Posted March 2, 2017 Love it! SvenFrankson 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.