I have already seen approches in three.js with ExtrudeBufferGeometry which makes this kind of bavelling possible.
Transferring the three.js source code ExtrudeBufferGeometry SourceCode in Babylon is a bit over my head as a beginner
Hope i made clear what im looking for, thanks in advance
Here, too. Someone doing something dangerousā¦ with a super-ellipsoid. hmm.
Hi Naz! Hi to you, too, Florianā¦ we hope you have had soft-edge success (4 months ago)
There is a BETTER super-ellipsoid playground here, somewhereā¦ had many shapesā¦ pyramids, boxes, convex/concave-curved box sidesā¦ all sorts of stuff. I canāt find the playground anymore.
Soft-edge mesh are cool, huh? They change the āfeelingā of a scene. The same happened when HTML/GUI allowed round edges. It sort of changed the feel of GUIās. For some timeā¦ EVERY GUI wanted to be round-corneredā¦ but then āthe trendā subsided a bit.
āGo rounded or stay groundedā (airplane tire company motto?)
See line 22? Just add many of those lines, and push various ādangerousā values into those parameters. Dangerous shapes.
Add some textures and scalings, some meshImpostors and sphereImpostors, some sparkly particles emitting from mesh normals, and boomā¦ weāve ā3d-addictedā the NEXT generation of BJS mad scientists.
Here is a search for playground seriesā¦ with āsuperelloā somewhere in their codes. Babylon.js Documentation. Party on.
Update:https://www.babylonjs-playground.com/#14VFYX#0 Thatās the one I was searching-for. I wonder who coded it. An interesting system, just like the other cool ideas/solutions in this thread. It seems to be all 6 or 8 -sided mesh, so far. No mention of āCatmullā either. I think Mr. Catmull was involved-in converting existing sharp-edged meshā¦ into round-edged. These Super-Elloās are actually āgrownā with rounded edges, so no Catmull-ish filing or grinding required.
Those rounded edges really improve child playpen swallow-ability. hah.
Hey guys, thanks for your responses and the shared playgrounds.
Because I havent had found any workarounds 4 months ago, I decided to give it a shot by myself.
It surely is no the smartest or fastest approach and its pretty hard to read, even for me now looking back on my code.
My goal was to create a box which has a tiny bit of bevel on the edges and corners, small enough that you hardly notice it, but big enough to add a little touch of realism to the box. I also wanted to use additional geometry as little as possible for performance reasons, so I only used 2 segments and worked my head around the topic smooth shading.
I couldnt use the babylon function forceSharedVertices() to achieve the smooth shading, it was necessary too keep all the vertices (even if they are at the same position) because I had to texture them differently. So I manipulated the vertex normlas by myself and achieved a nice smooth shading effect which looks pretty nice if you dont scale the bevel up toooo much
I did code locally, but the moment I saw some people are interested in this topic I created this playground. Its sometimes formatted a bit odd, sorry for that
I use your RoundedBox class and it works fine, but I wonder if itās possible to use a material with a texture with it. Somehow the box gets a solid color that is about the same as the texture, but not the texture itself:
const roundedBox = new RoundedBox(2, new BABYLON.Vector3(1, 1, 1), 0.2);
const box = roundedBox.toMesh('RoundedBox', scene);
let materialWood = new BABYLON.StandardMaterial("wood", scene);
materialWood.diffuseTexture = new BABYLON.Texture("textures/crate.png", scene);
materialWood.emissiveColor = new BABYLON.Color3(0.5, 0.5, 0.5);
box.material = materialWood;
As Evgeni told, the snippet doesnāt contain uv map, so texture wonāt work as is.
But, if you are not afraid with maths and programming, adding the uv map shouldnāt be so complicated, for example by applying a spherical projection for each vertex.
Unfortunately, this snippet doesnāt interest me anymore, so I have no time to do this for you.