danielepanozzo / gp

MIT License
65 stars 37 forks source link

Assignment1 shading #3

Open HerlinHe opened 2 years ago

HerlinHe commented 2 years ago

Hi Professor, I have a question about how to do the per_vertex_shading. I compute the exploded V and F, call "igl.per_vertex_normals" to get the per_vertex_normals, which is n, and plot the image using "meshplot.plot(exploded_v, exploded_f, n=n)". However, I got the exact same picture as per_face_normals. Is there anything wrong with my steps?

harshaxnim commented 2 years ago

This sounds like the same issue that I had. Assuming your normals calc. is right, just disabling flat shading, like so

meshplot.plot( ..., shading = {"flat": False})

should work IG.

HerlinHe commented 2 years ago

meshplot.plot( ..., shading = {"flat": False}) works for per_vertex_shading. But I still have a question about "exploding" the mesh. Exploding copies vertices and the number of faces does not change, right? I can draw the smooth shading without exploding by meshplot.plot(sphere_v, sphere_f, shading={"flat": False}), but still get flat shading with meshplot.plot(exploded_v, exploded_f, shading={"flat": False})

harshaxnim commented 2 years ago

Ah, I think the idea of the question is to get an "effect" of Flat Shading given a system that:

So, "flat": False for all parts of the shading question, but you get to play with vertices, faces and normals to achieve the desired style.