Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • chucky-xFebruary 26, 2009 5:27 AM PST   
    Receiving Renderable Mesh Information

    Dear Havok Users and Developers,

    I have a simple question, but I can not find any answer in this forum.

    I want to render a renderable mesh I have saved and exported in a hkx file.
    This hkx file (for testing purpose) is "hkLowResSkinWithEyes_L4101.hkx"
    and has been taken from the samples where you can see the beatiful havok woman.

    One way I have been working on to resolve the rendering issue is to convert havoks vertex buffer
    entries to my own one. That means for each vertex I get with collectVertexPositions I convert its positions.
    But here I can only resolve the vertex positions!
    I need the color, texture and perhaps other information too and there are no functions
    I can see to resolve this information for each vertex. When I look into the XML Viewer of this beatiful
    woman, I can see this information like this:

    <!-- hkxVertexBuffer @ 0x2dd4760 -->
    <hkobject class="hkxVertexBuffer">
    <hkparam name="vertexData" numelements="19">
    <!-- Homogeneous Class -->0x1bac434
    <hkobject>
    <hkparam name="position">(-0.001613 -0.021454 -0.000540 0.000000) </hkparam>
    <hkparam name="normal">(-0.063789 -0.993579 -0.093443 0.000000)</hkparam>
    <hkparam name="diffuse">0</hkparam>
    <hkparam name="u">0.786630</hkparam>
    <hkparam name="v">0.914357</hkparam>
    <hkparam name="padding">0.000000</hkparam>
    </hkobject>
    

    As you can see there are additional information like texture coordinates, not only positions.

    1) How can I get this additional information with havok?

    2) Are there other possibilities to render a mesh saved in a hkx file ( but not rendering physical data )?

    3) Is saving renderable mesh ( high-polygonal ) and havok needed data in one hkx a good solution?

    4) I have forgotten my fourth question but perhaps later I remember...

    Thanks in advice.






    havok.yoavFebruary 27, 2009 10:16 AM PST
    Rate
     
    Re: Receiving Renderable Mesh Information

    Hey chucky-x,
    As you can see there are additional information like texture coordinates, not only positions.

    1) How can I get this additional information with havok?

    This texture coordinate information is not an inherent part of Havok Physics and Animation and may change in the future. But, it is possible to access the information which you are looking for by going through hkxScene->hkxMesh->hkxMeshSection->hkxVertexBuffer after importing the hkxScene. For example:

    char* vData = scene[0].m_meshes[0]->m_sections[0]->m_vertexBuffer->getVertexData();

    You will then have to cast the data appropriately to retrieve the texture coordinates which you are looking for.

    For an example of how to import the hkxScene, check out the NormalBlendingDemo:

    Animation->Api->Blending->NormalBlendingDemo



    2) Are there other possibilities to render a mesh saved in a hkx file ( but not rendering physical data )?


    Havok contains a basic graphics engine intended for presenting the physical data. This is for debugging and displaying of the demos. The normal method of rendering the graphical scene in the game (without rendering the actual physical data) is to use a seperate graphics engine and load in assets which have been exported specifically for that graphics engine.



    3) Is saving renderable mesh ( high-polygonal ) and havok needed data in one hkx a good solution?


    As described above, the normal solution is to save out the renderable mesh seperately to a format used by the in game graphics engine.


    -Yoav

Forum jump:  

Intel Software Network Forums Statistics

16,377 users have contributed to 46,364 threads and 164,036 posts to date.

In the past 24 hours, we have 9 new thread(s) 29 new posts(s), and 20 new user(s).

In the past 3 days, the most popular thread for everyone has been Program compiles in release but not debug The most posts were made to You need to show us the whole The post with the most views is try_pop in concurrent_queue

Please welcome our newest member fruitbrown


For more complete information about compiler optimizations, see our Optimization Notice.