dilevin / computer-graphics-meshes

Computer Graphics Assignment about Meshes
1 stars 5 forks source link

per vertex normal weird output #47

Open Tomas-Ha opened 10 months ago

Tomas-Ha commented 10 months ago

my per vertex normal code creates a weird output. Is this what is should look like?

Screenshot 2023-10-20 at 10 08 28 PM Screenshot 2023-10-20 at 10 08 32 PM
Tomas-Ha commented 10 months ago

Specifically, the edge looks weird to me. I don't know if this is what it should look like. It has a weird rounding effect.

Zhecheng-Wang commented 10 months ago

It looks fine to me -- though the shading looks a bit weird. Can you double-check to make sure the normal is pointing outward?

Tomas-Ha commented 10 months ago

I am pretty confident that the normals are pointing outwards. When I flip the normal vectors, it removes all the lighting, and it creates this weird shading:

Screenshot 2023-10-21 at 9 39 43 AM Screenshot 2023-10-21 at 9 39 48 AM
Zhecheng-Wang commented 10 months ago

Note that triangle normal should return a normal of length $A$ where $A$ is the triangle area. Did you divide the cross product by 2?

Tomas-Ha commented 10 months ago

Yes I did, but for the vertex and corner, it is just a normal vector right?

Zhecheng-Wang commented 10 months ago

Yes. If you are worried about how the shading looks segmented on top, it is expected for per-vertex normal. I think all looks good.