How To Draw A Point Inside A Mesh?
I have multiple meshes, and want to add a point in a random part contained within hexagon[0]. how can I do it? var Hexagon=new Array(); Hexagon[0] = new THREE.Mesh( HexagonExtrude[
Solution 1:
If the mesh is of unknown shape (is it even closed?) then you either have to do something fancy like use signed distance fields, voxelization, or pick a point based on the bounding box as @gaitat has suggested. The reason samples use boxes and spheres is because those shapes have very well-behaved, simple-arithmetic properties. If you want to do fancier things like pick random points inside a random shape, well... that's much tougher!
Another approach you might consider is having invisible particle emitter zones that are part of your object. Your object might be shaped, say, like a monster in a game, but the particles inside it only come from a few spherical regions within the complex, deforming mesh. Not directly from the mesh itself.
Post a Comment for "How To Draw A Point Inside A Mesh?"