blocks icon indicating copy to clipboard operation
blocks copied to clipboard

Pointcloud world generator (PLY/OBJ/CSV)

Open eric-schleicher opened this issue 4 years ago • 10 comments

I have many many worlds created from scans available as quantized point clouds as well as in CSV based SVOs. Any thought s on how we might create a loader for non-image type worlds?

eric-schleicher avatar Jun 30 '20 05:06 eric-schleicher

Sure. Just send me a link with a downloadable example world and some doc on the file format. I will do the first draft of a world generator with that and then you can do the second pass on it after that.

danielesteban avatar Jun 30 '20 18:06 danielesteban

Been lookin on npm and it looks like there's already a nice library to make this types of model data available to the world generators: https://loaders.gl/modules/ply/docs/api-reference/ply-loader https://loaders.gl/modules/obj/docs/api-reference/obj-loader https://loaders.gl/modules/csv/docs/api-reference/csv-loader

I can easily create a generator that just applies a scale and even do multiple samples or something like that. I would still love to have some example models to test with and some working visualizer to check against.

danielesteban avatar Jun 30 '20 21:06 danielesteban

will do. I will go research and some back with more information!

eric-schleicher avatar Jul 01 '20 23:07 eric-schleicher

I've been using this to convert meshes and point clouds into SculptrVR's SVO text format.

This has been key script.
https://github.com/EX0l0N/ply-to-SculptrVR-csv

Essentially feed it a ply file with no normals and poof, voxels! being able to push these read only scans into a webxr experience would be very compelling.

here is an example. https://www.youtube.com/watch?v=q18XSQ6IKqc

eric-schleicher avatar Jul 03 '20 19:07 eric-schleicher

Sorry I've been on a custom blocks rabbit hole for a while and did not see this until now. That looks awesome. The only potential issue I see is that blocks has a fixed grid side of 0.5meters per voxel. It's not a tree or something like that is just a fixed array of fixed dimensions. Will like to try averaging them anyway to see how it looks. Do you have a pointcloud model to test with? Doesn't need to be one of yours, a public one hosted somewhere will do. I trying to search from some on sketchfab but I could find any that would work on a 0.5x0.5 meter grid.

danielesteban avatar Jul 09 '20 10:07 danielesteban

Is the underlying blocks model an integration volume along with (greedy) mesher? or just lots of cubes? (and are they instanced in the threeJS? or just many similar/simple copies)

Curiously the go script that converts data for sculptrVR to import does so at a single level of the octree (10). Since that's the case, you can use the output CSV data as a fixed voxel size description (with the benefit of the sparse allocation format format). this should import into block without issues, since there aren't octree levels in blocks; no foul.

e.g. one could read the csv, discard the level value. and just create cubes as a direct entries, or into the underlying volume model for blocks if that makes sense and is how it's done.

Separately one can then arbitrarity set the voxelspace scale to hit a specific relative scale to the user. I can actually calculate that proportion when i prepare the PLY files. Mostly it looks like the job would be row wise processing a unique list of materials/colors and then adding the right representation to the scene.

@BryanChrisBrown and I are discussing what needs to happen to bring into a vanilla threejs scene or react-three-fiber app

also attached in case you're interested in looking, is a larger version that has been succefully converted and imported into scultptrVR.

big-sculptrVR-csv.zip

eric-schleicher avatar Jul 18 '20 00:07 eric-schleicher

The meshing algorithm is kinda greedy.. it does not group faces in 2D but it only outputs the faces the are visible using the rules defined in each block type. And yeah, If they're equally spaced it should be easy to do an importer. I will give a try to import that csv. Thanks a bunch.

danielesteban avatar Jul 18 '20 20:07 danielesteban

FYI your progress reports on twitter are Great. trying to find a way to come contribute something of value.

eric-schleicher avatar Aug 17 '20 00:08 eric-schleicher

Thanks a bunch, dude. You're already contributing a lot of value just by giving me such positive feedback hehehe. BTW.. I kinda got stuck with this super generic voxel project and I pivoted it into a more specific cryptoart tool/gallery: https://github.com/danielesteban/nft-blocks https://nftblocks.gatunes.com/

This new project/repo is the one that I'm posting about on twitter lately.

danielesteban avatar Aug 17 '20 00:08 danielesteban

Another to try. 1.0_llama-back-8mpts_1000.zip

eric-schleicher avatar Dec 30 '20 19:12 eric-schleicher