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

  2. #2
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896
    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.

Similar Threads

  1. How to generate vertex and textures array data ?
    By seanshui in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-15-2015, 02:52 AM
  2. How to generate vertex and textures array data ?
    By seanshui in forum OpenGL ES
    Replies: 0
    Last Post: 11-15-2015, 02:38 AM
  3. multiple indices for different array (vertex, color,...)
    By Rhett in forum OpenGL: Advanced Coding
    Replies: 30
    Last Post: 11-15-2004, 09:04 PM
  4. What's the formula for number of indices for a vertex array?
    By swiych in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-16-2003, 05:00 PM
  5. Calculating triangle strip indices from vertex array
    By plucky in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-31-2001, 10:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean