Jump to content

Mesh without indices


Echnaton
 Share

Recommended Posts

Hello

I create meshes from scratch like it is described in https://babylonjsguide.github.io/advanced/Custom
I allready copy each vertex position as many times as I need it in order, so that I would not need the indices (they just go from  0 to n-1). So how can I get rid of the indices and create a vertexdata that does not use indices and apply it to an empty mesh? If I just omit the index array, it wont work. There is a method convertToUnindexedMesh(), but I would rather do it directly for performance reasons.

Thank you for any advice

Link to comment
Share on other sites

Hey @Pryme8 - doncha love it when DK "blows our minds"?  :)  I do.

But, you know, DK is swamped... so we should probably go web-browsing and learn about these un-indexed mesh... and what their story is.

Here's a quote from the Ogre3D manual... about "ManualObject":   

"Though all meshes have a vertex buffer, not all meshes will have an index buffer. For example, the mesh we are about to create will not have an index buffer since we want to create an empty rectangle (as opposed to a filled rectangle). Lastly, note that vertex and index buffers are usually stored in the video card's own memory, so your software can just send the card one simple, discrete set of commands to tell it to use those predefined buffers to render an entire 3D mesh in one go."

Here's a quote from another page

earth.positions

A flat Float32Array containing the vertices of each country on Earth. Note that this is an unindexed mesh, so if you were planning to render this with WebGL you can simply use gl.TRIANGLES without the need for a gl.ELEMENT_ARRAY_BUFFER.

P8... we probably see (not see) these unindexed "things" as NOT A MESH... by definition.  But, it appears that other folk... are willing to call it a mesh, even if it has no rendered faces.

Anyway, I simply did a goog search for "unindexed mesh", and got some decent returns.  It is probably easier for us to learn about it... on the web, than to make Deltakosh try to explain it to us in English puppy-talk. 

(I don't know if YOU need puppytalk, P8, because you are lots smarter than I.  But I need puppytalk (super-explaining)... because my brain is old and starting to petrify and atrophy.) :)

Did you write "Everything You Ever Wanted To Know About Mesh", P8?  What is taking so long?  :D

Link to comment
Share on other sites

Sorry I was unclear: A mesh is by definition a list of vertices and faces. But faces can be avoided if you consider that the faces are just inside the list of vertices: the first 3 vertices are the first face, the second 3 vertices are the second face and so on.

This is what an unindexed mesh is :)

And you can create one in babylon.js by calling mesh.convertToUnindexedMesh();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...