dilevin / computer-graphics-meshes

Computer Graphics Assignment about Meshes
1 stars 5 forks source link

Catmull Clark issue with the duck #51

Closed johnnyjly closed 10 months ago

johnnyjly commented 10 months ago

Hi. I don't know why but I always receive free(): invalid next size (normal) when running with the bob.obj. However, everything works fine if I switch to the cube. I'm working on WSL2 using VcXsrv for the display.

image image image

The duck does show up but whenever I press the space I receive the error. Is that anything wrong in my code? Or can I safely assume that my code (for the assignment) is correct but there might be something wrong with the glfw or x11 forwarding (I had some issues with these 2 before).

johnnyjly commented 10 months ago

Add-on: I tried to add some print statements within my code, and it shows that it does go into my loop and do the job, but raise the free() error when it is going out of the loop. So I tried to remove the loop (ignore the num_iterations) but it still doesn't work.

Zhecheng-Wang commented 10 months ago

Since you are WSL, please run gdb. do gdb ./quad_subdivision and then r to run. use command bt to print the stack trace leads to the error.

johnnyjly commented 10 months ago

Thanks for your comment. Actually I realized right after I posted this issue that there is a mistake in the size of a matrix, which leads to the corruption.