xiphiaz Posted July 16, 2018 Share Posted July 16, 2018 See my example: https://www.babylonjs-playground.com/#165IV6#435 I have a lathe mesh that is a swept surface, that I want to appear smooth around the surface, but not have the vertex normals be vertically smooth (if that makes sense?). Basically without converting to flat mesh, the normals make it appear to curve around hard edges that should remain to be hard. Is there a way I can update the normals to make it appear to have hard edges, but not be faceted on the cylindrical surfaces? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Pinging our lathe master: @jerome Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 17, 2018 Share Posted July 17, 2018 https://www.babylonjs-playground.com/#165IV6#436 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 17, 2018 Share Posted July 17, 2018 https://www.babylonjs-playground.com/#165IV6#439 What did I do ? I just repeated the points in the list where the normals musn't be smoothed. Nice hack Pryme8 ? Quote Link to comment Share on other sites More sharing options...
xiphiaz Posted July 31, 2018 Author Share Posted July 31, 2018 Awesome thanks @jerome & @Pryme8. For completeness this is what I ended up with. ```ts private generateFlatLathe(name: string, shape: Vector3[]): Mesh { return MeshBuilder.CreateLathe( name, { shape: shape.reduce((duplicatedPoints, point, index, allPoints) => { // only duplicate the non start & end points index !== 0 && index < allPoints.length - 1 ? duplicatedPoints.push(point, point) : duplicatedPoints.push(point); return duplicatedPoints; }, []), }, this.scene ); } ``` Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 31, 2018 Share Posted July 31, 2018 That is clean. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.