Texturing spatial mesh

Copper Contributor

Hi everyone,


I try to make an application that can export an obj file from the spatial mesh to show it in another software.

To add realism for my object, I want to add real world colors to this mesh.


So, here is my question :

How can I colorize my mesh to match the real room I scan ?



3 Replies

@Layra_Alixis I've seen people do this before, the idea is fairly simple, but the implementation details are definitely a bit tricky! I don't know of any off-the-shelf solutions for this, but I haven't been looking recently.


The core idea of this is to take color pictures as you wander around, and keep the camera position, orientation, and other details for that photo. Once you have a mesh of the room, that mesh needs UV coordinates that don't overlap! Create a blank texture, and then you can stamp, or project the photo onto that texture. This type of unwrapping and projecting may not be too tricky to figure out in a 3D modeling tool, but if you're doing this through code, it would definitely be a project!

I have to do it through the code so that the user can see in real time the virtual environment surrounding them.


I use Unity 2018.4.20 and MRTK 2.4

@Layra_Alixis Funny enough, while looking around for a good example, I spotted your StackOverflow question, and someone already linked you to the exact same PDF I had spotted!


From a cursory glance around, I can't really find any pre-baked solutions for this problem, so you're either going to have to do a lot more digging, or write this stuff from scratch. If you are going to write it from scratch, that paper may provide you with some great insight! From a quick skim, it looks like the right approach, and is more or less what I described in my previous post, except in much greater detail.