Huh? I must be blind, but the two look like literally the same code, where is the difference hiding?
BTW, what does “it doesn’t work” mean here? That is usually not a very useful problem description (i.e. one that makes a good answer possible), take a look at Forum Posting Guidelines for suggestions how to improve it.
Assuming the second code block was meant to look like
Thanks a lot, both of you! You’re both right… Ofcourse it was a really stupid copy/paste error I made, I had to remove a lot of comments so my mind was focused on removing comments instead of showing what I meant to show… And what I meant to show was:
Ofcourse it was stupid of me, not to end with an extra switch to the gl_modelview-matrix. This actually solved my main problem and confirms that I think I understand the difference between the two matrices, thanks!
Also thanks a lot for the glLoadIdentity-comment - I’ve now added that. Makes good sense…
Stupid of me - I actually knew the importance of ending with the modelview matrix, but somehow I’ve forgot…