Skip to content

Strange normals/faces when rendering in three.js #774

Answered by elalish
nmattia asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure what Three's computeVertexNormals is doing, but it's probably not what you want - I'd guess they're just computing average normals for each vert, thus giving a weirdly smoothed appearance.

As for the translation code, you'll notice that it doesn't save normals at all - hence black. I'm just in the process of building some APIs into Manifold to help handle normals, see ComputeNormals() in #771. You'll need to use our properties API, which is agnostic to what kind of data you store in it, so you'll need to choose some channels for normals and then read them into Three.js. You can also copy normals from Three.js into a mesh to pass to Manifold.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@nmattia
Comment options

@nmattia
Comment options

@elalish
Comment options

@hrgdavor
Comment options

@nmattia
Comment options

Answer selected by nmattia
Comment options

You must be logged in to vote
1 reply
@elalish
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants