Closed jeremyxu1998 closed 5 years ago
Hard to say but we will be compiling your code in Release mode so if it works there you should be good.
I'd do the following:
Print out all the information on the sphere faces, normals, etc, in both debug and release mode.
Paste it into diffchecker.com to see if they are the same. If they're not, then you have to step through and figure out where it is differing
Consider using UBSan from the clang
compiler. It would take a few minutes to set up (it's just adding -fsanitize
in cmake somewhere and then compiling it with clang++ IIRC). If you are doing something that is undefined behavior, it has a high chance of warning you. You can then fix it.
If you are hitting undefined behavior, you are risking a zero on this assignment because what might work on your machine (or even on certain runs on your machine) may segfault or crash (or worse) on any other computer. I am not saying you are doing UB, but when debug and release differ it's the first thing I'd investigate.
As title, the sphere will not display in debug mode (empty window with purple background), but shows perfectly in release mode. What could be the possible reason? Thanks!