Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Generate Indices array from Vertex array

  1. #1
    Newbie Newbie
    Join Date
    Oct 2013
    Posts
    2

    Cool Generate Indices array from Vertex array

    Hi Everyone,

    I am very new in Opengl programming. Can I know how to generate the Indices Array(Index) from a given Vertex Array in Triangle strip?

    and also

    How Can I convert an 3D Model into form of Triangle strip from any type of primitive (quad,polygon,triangle,..)?

    This two questions have been trapping me for 2 days


    Thank you
    Last edited by VirtualMan; 10-27-2013 at 04:26 PM. Reason: double check

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    Can I know how to generate the Indices Array(Index) from a given Vertex Array in Triangle strip?
    In general you can not. There is not enough information in a vertex array, it only stores data (position, normal, colour) at the vertices of an object, but no information about which vertices form a face (e.g. a triangle). So unless you have a special case where you have some additional knowledge which vertices form a triangle you can only use a general purpose algorithm for turning a point cloud into a polygonal model, e.g. the marching cubes algorithm. Or are you saying your vertex data is already organized as a single triangle strip?

    How Can I convert an 3D Model into form of Triangle strip from any type of primitive (quad,polygon,triangle,..)?
    Have you tried a search engine? Just using "triangle stripping algorithm" I get e.g. this, which at least first glance looks like a reasonable description. If you have non-triangles as input primitives, first convert them to triangles.
    You should probably also read Tom Forsyth' vertex cache optimzations - note in particular the "Background" and "Additional Notes" sections.

Posting Permissions

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