Dense Spatial Map: Access to whole mesh

0 votes
asked Nov 11 by pavlioudos (140 points)
Hi,

I try to save the whole mesh (all the mesh blocks) as obj but I can't get it to work. Is there a way to do this?

1 Answer

0 votes
answered Nov 11 by kenn (8,210 points)
DenseSpatialMapBuilderFrameFilter.MeshBlocks gives you all blocks. Treat those blocks like normal Unity meshes.
commented Nov 12 by pavlioudos (140 points)
Thank you so much! And one last question: I want to know the world coordinates of every block. I read in the code comments that I have to multiply the (x, y, z) index of the block with its physical size. How can I get the physical size?

Thank you again in advance!
commented Nov 12 by kenn (8,210 points)
The world coordinates is the Unity transform.position. Do you mean anything else?
commented Nov 12 by kenn (8,210 points)
If you mean the doc from csapi.cs, they are written for EasyAR Sense (using in or out of Unity), the Unity plugin has already converted the coordinates into Unity data.
Just think about how would do you get mesh vertext from a Unity mesh, it will be easier and more Unity natural way of doing things.
commented Nov 12 by pavlioudos (140 points)
The transform.position gives me (0, 0, 0) for every block.
commented Nov 12 by kenn (8,210 points)
Then they are (0, 0, 0). It does not mean the mesh vertexes will all be (0, 0, 0), right?
commented Nov 12 by kenn (8,210 points)
By the way, sorry about not pointing out directly how to get whole mesh in the script. I'm not quite skilled in making things using Unity, you would be expert on that.
commented Nov 12 by pavlioudos (140 points)
Yes I understand what you say. I just try to see if I have access to the center position of a mesh block. The x, y, z that I get from block info are integer and I thought I had to multiply them with physical size to get the actual block x, y, z. The reason I want this information is for the case that I instantiate the mesh in another scene for example.

Thank you
commented Nov 12 by pavlioudos (140 points)
I'm just a junior and I try to learn. I'm no expert for sure! And your answers help me a lot!
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...