In the opengl section of Hillegass' otherwise fine book, we're given sample code for drawing a 3d object on a view. Two people at the book's discussion forum at http://techstra.bignerdranch.com/ have reported that the drawing 开发者_开发知识库code runs, but fails to draw the object. I'm getting the same result, and the only discussion I've found resolves to a solution for a fix to the Ubuntu port of OpenGL, not much help to us trying to get this working on the mac.
Seeing how the code successfully changes the bg color, everything's apparently wired up. Maybe the object is written out of the viewport. Has anyone else tried this code and gotten it to work?
I just tried it. Works fine. You can download my project here.
精彩评论