简体   繁体   中英

Save 3D modles with textures in kinectfusion

With the lates update of kinect sdk which is v 1.8 now I can scan objects with textures. But how we can save 3D models with textuers? Available options are save as .obj , .ply , .stl but when I load saved models into 3ds max I can't see any texture only grey mesh. This is about my final year university project so please help me.

I know that this thread is gathering a bit of dust now, but I've been addressing similar issues lately and thought I'd share the results.

I have (at least partially) worked around the issue by converting the PLY file to WRL using MeshLab and then importing the WRL file into 3DS Max. That seemed to do the trick fairly easily.

All I need now is to discover how to export the file out again once I've monkeyed with the texture.

When exporting to obj together with a texture, then you have a '.mtl' file along with your obj file. this file contains the material definition.

so I made a box in 3dsmax, add a simple tga texture in diffuse slot, then export as obj with material.

the .mtl file then looks like this (named the same as obj file, but with mtl as file extension):

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 04.11.2013 11:48:56

newmtl 01___Default
    Ns 10.0000
    Ni 1.5000
    d 1.0000
    Tr 0.0000
    Tf 1.0000 1.0000 1.0000 
    illum 2
    Ka 0.5882 0.5882 0.5882
    Kd 0.5882 0.5882 0.5882
    Ks 0.0000 0.0000 0.0000
    Ke 0.0000 0.0000 0.0000
    map_Ka C:\Users\asdf\Documents\3dsmax\sceneassets\images\Snake_Skin.tga
    map_Kd C:\Users\asdf\Documents\3dsmax\sceneassets\images\Snake_Skin.tga

It then also reads this when importing it into 3dsmax, so with the kinect SDK code just create this mtl file, add the filename etc, then save it alongside your obj. Then you can easily import into max with texture.

By default, 3dsmax doesn't show vertex colors in the viewport or render. You shouldn't need a .mtl file as these materials can be made by hand. obj files only support one uv channel and do not support a vertex color channel.

Try turning on the vertex colors in the object properties. You can change the channel the vertex colors come from. They are probably in Vertex Color or map channel 1, the data is the same for all these channels so they let you pick any one for display.

You should diagnose the issue here in the viewport. If you see the colors you desire here, then they are indeed stored as vertex colors. If you instead see a gradient of a rainbow of colors then this is uvw mapping. This might also be a black, cyan, yellow, etc if the uvw's are in world units. If all the map channels and vertex channels are black, then you have no color or mapping data.

For a render, assign a material with vertex colors map in the diffuse channel, or a bitmap if they are uvw mapping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM