geometry.computeVertexNormals() not working for extruded geometry
See original GitHub issueDescription of the problem
geometry.computeVertexNormals() not working for extruded geometry created using absarc.
Best explained with pictures and fiddle.
https://jsfiddle.net/k2r4cqnh/2/
I have also tried geometry.computeFaceNormals
and shading: SmoothShading
but no dice!
You get the same problem with the shape with/without a hole.
Three.js version
- r81
Browser
- All of them
OS
- Windows
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (2 by maintainers)
Top Results From Across the Web
Any better implementation of ExtrudeGeometry? - three.js forum
It all works fine until you want to achieve smooth shading, where using geometry.computeVertexNormals(true) then fails for the obvious reason ...
Read more >THREE.ExtrudeBufferGeometry has very few polygons
computeVertexNormals() geometry.center() return geometry. I create a geometry and create a 3d mesh out of it. The problem is that the ...
Read more >Three.js Custom Geometry
computeVertexNormals ();. Unfortunately a cube is not a good candidate for vertex normals since it means each vertex gets its normal from the...
Read more >Introduction to Computer Graphics, Section 5.2
The computeVertexNormals() method can still be used for a BufferedGeometry that has an index array. To compute a normal vector for a vertex,...
Read more >Compute Vertex Normals for Buffer Geometry in threejs
In some cases I might have to work this out manually it would seem, however in most cases just calling the compute vertex...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@WestLangley - I agree that we shouldn’t modify
geometry.computeVertexNormals()
directly but there should be a THREE method to achieve smoothing the faces of an extruded shape without artefacts. I am now using asmoothExtrudedGeometry()
function based on the discussion in this thread. A nice example of this is the elimination of some bezier scaring on some 3D extruded helical gears. See before and after below…before
smoothExtrudedGeometry()
after
smoothExtrudedGeometry()
I think the above image of gears shows that THREE.js can be a fantastic direct modelling tool. Given the many parameters used to describe certain geometries (such as gear teeth) it would not be practical to develop templates of such models if you want to dynamically change their attributes based on some user input. Or have I misunderstood something about THREE.js?
@henryJack if you add after
geometry.computeVertexNormals();
you will see that the ring is smooth. I can’t remember how to make the sides flat though…