none
Some questions about KinectFusion API c++ RRS feed

  • Question

  • Hi Everyone :),

    First of all, sorry if you don't understand my questions or words, i'm french so I'll try to make simple words ^^

    So i am a beginner in c++ and i am working with the KinectFusion API in c++.

    I have a couple of questions (2/3 questions : tell me if i have to do one question at the time, i will create a new subject if that's the case ^^).

    First question : I am actually adding some features to KinectFusion, but i also would like to add some buttons for example, and I can't find the related files in the project solution. Where can I find them (ofc if it's possible :) )?

    Second question : I would like to use the function WriteTexturedeAsciiObjMeshFile(...) in the KinectFusionHelper file but i have no clue in how to get the "const std::vector<Vector3> &texcoords" (the last parameter) in the function. I have searched and found this topic (https://social.msdn.microsoft.com/Forums/en-US/4c70a618-3e98-4789-8aa7-77fdc7217afe/what-is-texcoords-of-writetexturedeasciiobjmeshfile-contained-in-kinectfusionhelper?forum=kinectsdk) but there is no answer for the use of the function, so could you please tell me how to use it ? (ofc if we can).

    I also note that when i was looking to the WriteAsciiObjMeshFile() function:

     // Sequentially write the 3 vertex indices of the triangle face, for each triangle
        // Note this is typically 1-indexed in an OBJ file when using absolute referencing!
        for (unsigned int t=0, baseIndex=1; t < numTriangles; ++t, baseIndex += 3) // Start at baseIndex=1 for the 1-based indexing.
        {
            written = sprintf_s(outStr, bufSize, "f %u//%u %u//%u %u//%u\n", 
                baseIndex, baseIndex, baseIndex+1, baseIndex+1, baseIndex+2, baseIndex+2);
            fwrite(outStr, sizeof(char), written, meshFile);
        }

        // Note: we do not have texcoords to store, if we did, we would put the index of the texcoords between the vertex and normal indices (i.e. between the two slashes //) in the string above

    I think there is a link between that and my second question but i don't really understand well the sentence (more precisely what should I type)

    Hope someone will answer me ^^ !

    Thank you.

    Monday, June 22, 2015 11:24 AM

Answers

  • Honestly, if you're just beginning, I recommend that you look at the managed .Net version of Kinect Fusion Explorer. The native C++ version requires knowledge of C++ Windows Api calls, Resource Scripts, Dialogs, and DirectX libraries. This is not for the beginner by any means.

    1)

    Just me explaining how to put a button would be overkill, but here it goes anyway...

    The native C++ sample is built to show how to build Native win32/64 apps for utilizing Kinect with Windows. It is not the easiest thing to pick up, and the simple tasks are very tedious and mundane. To Add a button you need to modify the resource script file located in the project. You can do so by using the resource editor that comes with VS.Net. Add any button you want to the dialog, then add a constant representing that resource. Here's a tutorial (http://win32developer.com/tutorial/windows/windows_tutorial_3.shtm)

    2) This question is about writing a object mesh file to ascii for a mesh. It could be used with a pixel shader. The best way to do that is to use the .ply file format. You'll need to read up on how to use vertex shaders and pixel shaders to really comprehend this. Drawing color on a mesh requires vertex and pixel shaders. Drawing the mesh just requires a 3-D Drawing context, filling with color requires pixel shaders with the HSL language.

    HTH


    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog: http://dgoins.wordpress.com

    • Marked as answer by NocDev Wednesday, June 24, 2015 9:39 AM
    Tuesday, June 23, 2015 8:24 PM

All replies

  • Honestly, if you're just beginning, I recommend that you look at the managed .Net version of Kinect Fusion Explorer. The native C++ version requires knowledge of C++ Windows Api calls, Resource Scripts, Dialogs, and DirectX libraries. This is not for the beginner by any means.

    1)

    Just me explaining how to put a button would be overkill, but here it goes anyway...

    The native C++ sample is built to show how to build Native win32/64 apps for utilizing Kinect with Windows. It is not the easiest thing to pick up, and the simple tasks are very tedious and mundane. To Add a button you need to modify the resource script file located in the project. You can do so by using the resource editor that comes with VS.Net. Add any button you want to the dialog, then add a constant representing that resource. Here's a tutorial (http://win32developer.com/tutorial/windows/windows_tutorial_3.shtm)

    2) This question is about writing a object mesh file to ascii for a mesh. It could be used with a pixel shader. The best way to do that is to use the .ply file format. You'll need to read up on how to use vertex shaders and pixel shaders to really comprehend this. Drawing color on a mesh requires vertex and pixel shaders. Drawing the mesh just requires a 3-D Drawing context, filling with color requires pixel shaders with the HSL language.

    HTH


    Sr. Enterprise Architect | Trainer | Consultant | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer |blog: http://dgoins.wordpress.com

    • Marked as answer by NocDev Wednesday, June 24, 2015 9:39 AM
    Tuesday, June 23, 2015 8:24 PM
  • Seems like i have a lot to learn about before doing anything else ^^. I am going to check out the managed .Net version. Thanks for the reply and your honesty !
    Wednesday, June 24, 2015 9:39 AM