vkRayIntersection and getting face information

(3 posts) (2 voices)
  • Started 10 months ago by Octarina
  • Latest reply from flamenco
  1. Octarina

    member
    Joined: May '13
    Posts: 43

    Hello

    In my project, the user needs to pick an object in a scene, and then the edge information about the actual face picked is needed. I am tantalizingly close, but I cannot seem to put together the different pieces.

    In vkRayIntersection we have a number of fields that show up in AutoComplete, but are not documented
    - geomPrimitive
    - featureIndex
    - numPointInFeature
    - polygonTriangleIndex
    - ptCoeff
    - ptIndex

    My guess is that these may link up somehow to give me the geometry information I need to access the face data using (for example):

    VertexNUV* vertData = (VertexNUV*)geomPrimitive.LockVertices(0, geomPrimitive.GetVerticesCount(), 0, 0);
    // Do someting with the vertices....
    geomPrimitive.UnlockVertices(0);
    
    ...
    
    uint16* indices = geomPrimitive.LockIndices(0, prim.GetIndicesCount(), FLockFlags::fReadOnly);
    // Do someting with the indices....
    geomPrimitive.UnlockIndices();

    My question is: how do those returned fields in vkRayIntersection match up to indexes/vertices in the geomPrimitve?

    Thanks for the help!

    Posted 10 months ago #
  2. Octarina

    member
    Joined: May '13
    Posts: 43

    Just a friendly bump so that this post does not get lost... any help would be greatly appreciated!

    Posted 10 months ago #
  3. flamenco

    3DVIA Studio Guru
    Joined: Sep '09
    Posts: 148

    Hi,
    You could directly retrieve vertex indices through ptIndex[0], ptIndex[1], ptIndex[2], then retrieve each vertex position locking vertices buffer as you already do.
    Please find attached a little sample that place little boxes at picked triangle vertices.
    Cheers,
    Arnaud.

    Attachments

    1. RayIntersectionArchive.mpexp (94.5 KB, 12 downloads) 10 months old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 10 months ago #

Reply

You must log in to post.