Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Can Meshes have more than 3 vertices?

edited February 2012 in Questions Posts: 12

Before I go out and try this by myself: Can Codea's mesh feature support more than three vertices/points?


  • SimeonSimeon Admin Mod
    Posts: 4,144

    Yes, they can support an arbitrary number of vertices. Each triplet of three vertices is interpreted as a triangle.

  • edited February 2012 Posts: 2,160

    The mathematician in me feels compelled to correct that. A mesh can suport an arbitrary number of triples of vertices. You can't feed it 10 vertices, or 100, for example.

  • SimeonSimeon Admin Mod
    Posts: 4,144

    @Andrew is correct

  • BortelsBortels Mod
    Posts: 1,557

    What happens if you feed it 10?

    If it errors out, Andrew is correct. If it ignores the extras, Simeon is right.

    But I don't know that either actually addresses the question directly. I read it as "if I pass 4 vertices, do I get a square?". The way to get a square, for example, is to use two triangles, or use the convenience function who's name escapes me right now because I'm tired and my kids have kidnapped my ipad.

    The pedantic nerd in me says "arbitrary is incorrect - you must feed it a natural number of triples to have a visible effect (not pi or -1 or such), subject to limitations of the engine and iPad memory". And I'm not even sure that is right, as while the memory on the ipad2 is doubled, I don't know if that affects the GPU.

    I apologize for all of the above. I'm beat, and in a silly mood.

  • SimeonSimeon Admin Mod
    edited February 2012 Posts: 4,144

    10 vertices generates an invalid mesh (won't draw, mesh.valid flag is false). It's due to the structure used. Meshes are rendered with GL_TRIANGLES. This interprets triplets of three vertices as triangles, it is the only polygonal structure available on iOS. Desktop systems usually have GL_QUADS and GL_POLYGON available.

Sign In or Register to comment.