0

I want to create a meshed object like the pic below. (Please ignore the coin besides it.)

img

The thing is, I want to set a light behind the meshed object and make the light scatter through the meshes. (it's almost like a lamp below.)

img

The camera will be located right in front of the meshed object, so the object itself doesn't need to be a 3d cube like this pic though.

I'm very new to three.js and was not able to find a way to make a object like the one described above.

            geometry = new THREE.BoxGeometry(1, 1, 1);
            material = new THREE.MeshPhongMaterial({ color: 0x000000 });
            box = new THREE.Mesh(geometry, material);
            scene.add(box);

Could anyone advise me how I can I achieve this?

Spektre
  • 49,595
  • 11
  • 110
  • 380
gwen
  • 95
  • 8
  • Maybe you can use the following example as a code template: https://threejs.org/examples/webgl_shadowmap_pointlight The interesting part is the usage of an alpha map in order to create the see-through parts of the mesh and the respective shadows. – Mugen87 Mar 30 '19 at 13:40
  • "*A meshed object*" is not very specific. Any meshed object? What happened to the approach in [your last question](https://stackoverflow.com/questions/55417658/set-transparent-opacity-0-to-some-faces-of-a-sphere-geometry)? Instead of making faces transparent, it will be easier to just delete them. – Nico Schertler Mar 30 '19 at 23:09
  • Looks like basic shape with holes ... if the case you can do something like this: [I have an OpenGL Tessellated Sphere and I want to cut a cylindrical hole in it](https://stackoverflow.com/a/39466130/2521214) if arbitrary then 3D model or use 3D scanner ... If you know the symmetry and basic shapes object is composed of you can use CSG lib (constructive geometry) ... – Spektre Apr 02 '19 at 08:03

0 Answers0