Jump to content

Switch Faces in Mesh


ocarlos
 Share

Recommended Posts

It looks like the Mesh class has the method getVerticesData(kind, copyWhenShared). IIUC it's supposed to return an array of whatever vertex data you specify in "kind", so I guess you could ask for the normals and reverse them. As long as you don't ask for a copy the changes should apply to the mesh automatically, IIUC. Although I have no idea how to specify the kind for a normal, as BABYLON.VertexBuffer.NormalKind can't be used there... There's also getVertexBuffer(kind). Maybe wait for more help or search, but hopefully I hinted you closer to your goal and didn't introduce more confusion.

 

Edit: Looks like this is what you're looking for: flipFaces(flipNormals) 

Link to comment
Share on other sites

Made a project just focusing on the issue I am having.

Just some context, the origin of my need to flip faces is some quirk in the blender model that I am using. When exported the face gets inverted (this happens in multiple export formats so I am assuming this is more of a blender issue).

So quite simply I figured flipping the faces programmatically after import would fix it.

quickndirty.zip

EDIT: Nevermind... checking this more closely the exported model does not simply have its faces flipped, there is something more... if I turn off backface culling the model is more correctly displayed... 

Will try to fix this at the source, that is at blender level.

Thanks for the help.

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