Results 1 to 5 of 5

Thread: I'm Having trouble expanding the geometry from primitives.

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    16

    I'm Having trouble expanding the geometry from primitives.

    Basically, I'm trying to render the mesh from the texturedcube example.
    The data points seem to expand out to invalid coordinates, and so I'm wondering if the documentation is correct, or if I've somehow misinterpreted it.

    Here is the file that I'm using for my example. (I got it from the examples on another part of this forum)
    http://home.comcast.net/~abradsn/texturedcube.dae

    Here is a picture describing my problem.
    http://home.comcast.net/~abradsn/Geo...tured-Cube.JPG


    Thanks,
    Brad

  2. #2
    Junior Member
    Join Date
    Mar 2005
    Location
    Lulea, Sweden
    Posts
    29
    You have to read the polygons input semantics in order to see which array you get your information.

    This example probably has three semantics values:
    Code :
    <input semantic="VERTEX">
    <input semantic="NORMAL">
    <input semantic="TEXCOORD">

    or something similar. The VERTEX semantic point to a source element that have vertex specific data. This source element have an accessor that tells you what data the vertices contains. This means it can have, and will likely have, POSITION data, but it can also have NORMAL and TEXCOORD data per vertex and not as in the input semantics, per face.
    NORMAL and TEXCOORD semantics have sources that points to their respective look-up-arrays.

    From your picture it seems you read every index as a x, y and z position. This is wrong.
    The first occurrence in the first

    elements is:
    Code :
     
    0 0 0 2 1 1 3 2 2 1 3 3</p>

    IF you have the above semantics than this face consist of vertices 0, 2, 3 and 1. The normals is from index 0, 1, 2, 3 and the texture coordinates for the vertices are from index 0, 1, 2 and 3 in the source array pointed to from the input semantic of TEXCOORD.
    And each vertex consist of a x, y and z element. So this first face consists of coordinates (-50, 50, 50), (-50, -50, 50), (50, -50, 50 ) and (50, 50, 50 ).
    / Master Tonberry

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    16

    I think I get it. Please help confirm.

    What, I'm still not sure about is how I read them in correctly. Or maybe I do have an idea and just need to confirm that it is what you are saying.

    Basically are you saying that (probably according to the technique or semantic or something) that these indices break down as follows:
    0 0 0 2 1 1 3 2 2 1 3 3

    Broken down by groups of three:

    0 0 0
    2 1 1
    3 2 2
    1 3 3

    From left to right.
    The first vertical row indicates the indices for the vertices.
    The normals are the next vertical row.
    The texCoords are the last vertical row.

    What about the last primitive with data like? It looks like this.
    5 20 20 7 21 21 6 22 22 4 23 23

    5 20 20
    7 21 21
    6 22 22
    4 23 23

    So, If I am understanding correctly, then the polygon for this face is made up of the indices at (5, 7, 6, 4).
    50, 50, -50
    50, -50, -50
    -50, -50, -50
    -50, 50, -50

  4. #4
    Junior Member
    Join Date
    Mar 2005
    Location
    Lulea, Sweden
    Posts
    29
    Yes that is correct if the order of the input elements are:
    Code :
    <input semantic="VERTEX">
    <input semantic="NORMAL">
    <input semantic="TEXCOORD">
    / Master Tonberry

  5. #5
    Junior Member
    Join Date
    Oct 2005
    Posts
    16

    Great!

    Awesome! Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •