gp
gp copied to clipboard
Assignment1 shading
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?
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.
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})
Ah, I think the idea of the question is to get an "effect" of Flat Shading given a system that:
- only supports per-vertex normals,
- and the shader uses these normals for lighting calculations.
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.