jerome Posted April 30, 2015 Share Posted April 30, 2015 Hi people, As it was asked by some people, I could implement a cap option in Tube and Extruded mesh types.This would add another parameter in functions already quite rich in parameters ... Just a matter of practice. Since BJS 2.1 is not yet released as stable (BTW is there a planned date ?), I could set this parameter before "scene" in the parameter order, because there are yet other general (for all mesh types) and optional parameters after "scene" : upgradable, orientation, instance. This new parameter could have different values :0 = no cap1 = cap at axis starting point (top)2 = cap at axis endinf point (bottom)3 = both I would do this because I realize it's quite difficult for a user to cap a parametric mesh with strange shapes after it is initially computed.Moreover it would need a lot of maths if the mesh should be then animated or morphed. Any thoughts ? Jaskar 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2015 Share Posted April 30, 2015 No problem on my side. 2.1 is not yet done as I would like to integrate webworkers for collisions as well so it's a green light for me! Quote Link to comment Share on other sites More sharing options...
jiweigang1 Posted May 1, 2015 Share Posted May 1, 2015 its great Quote Link to comment Share on other sites More sharing options...
jerome Posted May 1, 2015 Author Share Posted May 1, 2015 okadded one line in my backlog Quote Link to comment Share on other sites More sharing options...
jerome Posted May 5, 2015 Author Share Posted May 5, 2015 PR for tube cap Quote Link to comment Share on other sites More sharing options...
jerome Posted May 5, 2015 Author Share Posted May 5, 2015 WARNING For tube mesh users only :As BJS 2.1 is not released the tube creation method is not fixed. It has just changed :var tube = BABYLON.Mesh.CreateTube(name, path, radius, tessellation, radiusFunction, cap, scene);There is now an extra parameter cap just before the scene parameter in the call signature. cap allowed values :0 = no cap1 = cap on start2 = cap on end3 = both Quote Link to comment Share on other sites More sharing options...
jerome Posted May 5, 2015 Author Share Posted May 5, 2015 PR for extrusion cap WARNING For extruded shape users only :As BJS 2.1 is not released the extrusion method is not fixed. It has just changed :var ex = BABYLON.Mesh.ExtrudeShape(name, shape, path, scale, rotation, cap, scene);var cstm = BABYLON.Mesh.ExtrudeShapeCustom(name, shape, path, scaleFunction, rotateFunction, ribbonCloseArray, ribbonClosePath, cap scene);There is now an extra parameter cap just before the scene parameter in the call signature. cap allowed values :0 = no cap1 = cap on start2 = cap on end3 = both As the shape to be extruded is parametric and so unpredictable, its barycenter is taken in account to set the cap center. Quote Link to comment Share on other sites More sharing options...
jerome Posted May 5, 2015 Author Share Posted May 5, 2015 Please use now constants instead : BABYLON.Mesh.NO_CAPBABYLON.Mesh.CAP_STARTBABYLON.Mesh.CAP_ENDBABYLON.Mesh.CAP_ALL Quote Link to comment Share on other sites More sharing options...
jerome Posted May 6, 2015 Author Share Posted May 6, 2015 PR mergeddocumented Temechon 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted May 7, 2015 Share Posted May 7, 2015 I propose to change your nickname from Jerome to RIBBON GOD! What do you think ? GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted May 7, 2015 Author Share Posted May 7, 2015 Don't you have anything bigger than god please ? GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted October 7, 2015 Author Share Posted October 7, 2015 I just at last did a PR to fix the tube and extrusion cap light artifacts. adam 1 Quote Link to comment Share on other sites More sharing options...
AussieKSU Posted November 20, 2015 Share Posted November 20, 2015 I observed in the behavior of capping extrusions that it is doing something like tessellating each (subsequent)vertex pair of the profile with a centerpoint of the extrusion. This will give a nice result for some profiles, but not all. I am sure it has been considered that the created cap could be drawn with "overhanging" parts if the tessellated triangle overlaps the line from another vertex pair. Is there a way to get around this? I am happy to create some playground code to show this, but I am sure, if I have explained well, that you'd already be familiar with the problem. Quote Link to comment Share on other sites More sharing options...
AussieKSU Posted April 21, 2016 Share Posted April 21, 2016 If anyone is interested, a nice solution to "capping" can be found using Poly2Tri, and creating your own caps with the BABYLON.PolygonMeshBuilder. GameMonetize 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.