dilevin / computer-graphics-meshes

Computer Graphics Assignment about Meshes
2 stars 5 forks source link

cube.cpp weird result #65

Open MelodyZ708 opened 1 day ago

MelodyZ708 commented 1 day ago

The image below is the meshed cube after running my program. The color of the grid does not seem to be correct. What could be the problem? Does it have to do with UV and UF?

image
ZewenShen commented 1 day ago

I assume that you haven't incorporated the texture information; otherwise, it should resemble a Rubik's Cube. First, verify the number of faces on your cube. There should be six, but your image appears to have 24 faces (6 × 4). Additionally, check the signs of the normal vectors.

MelodyZ708 commented 1 day ago

the faces look correct now, but it still cannot capture the meshes. By "incorporating the texture information", do i also need to incorporate into cube.cpp? I notice in obj.cpp, "set_texture_from_png("../data/rubiks-cube.png", v.viewer.data())" should already capture the texture information.

image

I assume that you haven't incorporated the texture information; otherwise, it should resemble a Rubik's Cube. First, verify the number of faces on your cube. There should be six, but your image appears to have 24 faces (6 × 4). Additionally, check the signs of the normal vectors.

ZewenShen commented 1 day ago

You have to set UV and UF correctly. Did you watch the tutorial video that I sent out?