Jump to content

Vertices Position on cube


Xav
 Share

Recommended Posts

a cube has 6 sides

each side is composed with 2 triangular facets, so 4 vertices.

Side vertices aren't shared with other sides so they can hold different UVs and normals per side.

I total : 4 * 6 = 24 vertices... some are in the same location.

Link to comment
Share on other sites

thank you Jerome

I'm ok with you all 24 vertices match with  nbrVertices = cube.getTotalVertices ();

I follow you well on the 6 face with 4 vertices per face.
There are then 6 vertices of each face that have the same coordinates.

What I would like to do is group them ... :huh: like this

exemple.jpg

Link to comment
Share on other sites

Create an array with vertices that are the same coordinated in the same index
for example
myCubeVertices = [[all vertices with same coordinates xyz], [all vertices with same coordinates xyz], ...] ?
Does this seem to me easier to visualize and manipulate?

 

Link to comment
Share on other sites

27 minutes ago, Xav said:

Create an array with vertices that are the same coordinated in the same index
for example
myCubeVertices = [[all vertices with same coordinates xyz], [all vertices with same coordinates xyz], ...] ?
Does this seem to me easier to visualize and manipulate?

 

Hi @Xav

Group Vertices

https://playground.babylonjs.com/#3CZLNK#1 

Link to comment
Share on other sites

I continued my research and I also found this post which helps to understand the function:

On the other side I haven't found information to adapt the uv according to the new position of vertices?

var uvs = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind);

mesh.setVerticesData(BABYLON.VertexBuffer.UVKind, uvs);

What is the relationship between a vertex position vector3 and a UV position vector2 ? :unsure:

Thanks

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...