OiO.lk Blog javascript Extruding a 2D PNG into a 3D Mesh in BabylonJS
javascript

Extruding a 2D PNG into a 3D Mesh in BabylonJS


In BabylonJS, I’m attempting to extrude a 2d png image to a 3d mesh, whilst I’ve considered obtaining the contours/outline of the image by extracting the alpha channel of the image and then using the results to create an extruded polygon. I’ve gone with a more straight forward method which merely seeks to stack multiple planes of the png image, I then merge the result into a single mesh. Whilst this DOES work in the main, I’m noticing artefacts at extreme angles i.e 90 degrees, at this angle the planes that make up the mesh are clearly visible.

Is there a way to stack the planes so closely that the individual planes are not visible at any angle of the resulting mesh? Alternatively, once I have the shape of the mesh can it be filled to remove any gaps present between the planes. Please see the following Playground, you’ll note that if you rotate the mesh by 90 degrees, on any axis, a “plane” distortion occurs as each individual plane orientates towards the camera:



You need to sign in to view this answers

Exit mobile version