If you would like to build an editor to shape arbitrary 3D room shapes (one closed volume) would you build one BufferGeometry or one mesh per wall?
- Custom BufferGeometry
- One Mesh Per Wall
- Something totally different
I am currently building a web-app to model a rooms volume. The volume is used to calculate room acoustics in a second step (fininte element method on the server).
So, instead of building walls and allowing everything that you can do in 3D editors/CAD programs, I want a small feature set to work with one 3D body that is always closed (as being closed is necessary for the acoustics calculations).
For the first version of the editor I did a shortcut. At the moment users can model a 2D shape of the floor and provide a height. I extrude the room volume from that.
To get an idea, you can try out the current version here.
At the moment I use an
ExtrudeGeometry with two materials (walls are brighter than floor/ceiling).
To emphasis the edges I add another mesh for each room edge: a
BufferGeometry from 2 points with a
Now I will improve the editor by allowing to further model this 3D volume. The current
ExtrudeGeometry will not work for arbitrary shapes so I have to replace that.
I see the two mentioned possibilities
- A custom BufferGeometry with a ShaderMaterial where I add/move/delete points in the geometry and write a custom shader to do things like emphasising edges
- One mesh per wall/floor/ceiling/edge with different materials
From a performance point of view (1) will be better but (2) sounds a lot easier for doing things like selecting walls and edges. In both cases I would add small boxes and 3D arrows to visualize where you can grab and move.
My assumption is the performance gain by doing (1) does not matter (relatively small number of walls for realistic rooms). The results of the acoustic calculations will be more heavy weight from a performance perspective (at the moment I draw thousands of sprites for that but I want to change that to classic volume rendering in another iteration…you can also see the current sprites in the link above when you click the “calculate 5 modes” button).
As I am not very experienced in threejs or building 3D software in general I would love to get some thoughts of this great threejs community. This website is a one-man-project and I miss the possibility to dicuss it :D. It’s also perfectly possible that I miss a third, much better possibility totally.
I hope some of you like to confirm or challenge my thoughts above!
If you stumbled upon similar stuff, please tell me as well