Skip to content

Added shape::Cylinder#305

Closed
davidhof wants to merge 4 commits intobevyengine:masterfrom
davidhof:patch-1
Closed

Added shape::Cylinder#305
davidhof wants to merge 4 commits intobevyengine:masterfrom
davidhof:patch-1

Conversation

@davidhof
Copy link
Copy Markdown
Contributor

Added a cylinder shape to mesh.rs
image

@Moxinilian Moxinilian added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen labels Aug 24, 2020
@Philipp-M
Copy link
Copy Markdown
Contributor

Shouldn't the top bottom planes be separate faces to preserve correct (vertex-)normals?

@davidhof
Copy link
Copy Markdown
Contributor Author

Shouldn't the top bottom planes be separate faces to preserve correct (vertex-)normals?

Not sure what you mean by planes?
Its a triangle list so the order may be a bit weird (it alternates top and bottom triangles) but it should make no difference.
And the normals are simply derived from the vertex positions.

@Philipp-M
Copy link
Copy Markdown
Contributor

I mean, that the whole mesh should probably be 3 separate faces (a top/bottom face and the round face in between). For this the vertices have to be duplicated for the top and bottom part and separate normals have to be provided that show towards the up/down direction. This is necessary for e.g. correct lighting/ normal interpolation.

Fixed normals by duplicating top / bottom ring of vertices
@davidhof
Copy link
Copy Markdown
Contributor Author

Thanks @Philipp-M !
It definitely looks nicer now.
2020-08-26-09-04-57

@davidhof davidhof closed this Sep 8, 2020
@cart
Copy link
Copy Markdown
Member

cart commented Sep 8, 2020

Any reason for closing this other than my slow response time?

(Sorry about that by the way)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants