I am quite new to OpenGL but I am trying to figure out how to draw things in 3D. I am trying to write a simple program in Xcode for Mac OSX which uses OpenGL library and the NSOpenGLView class to draw OpenGL graphics. I want to figure out how to change the position of the “camera” so the object can be viewed from top, bottom, right, left, at an angle, etc. The thing that is not working for me is the glLookAt() method. Apparently it was deprecated and now I have to use GLKMatrix4MakeLookAt(); The big problem though, is that this method appears to do nothing.
this is my method do do the basic drawing and change the position of the camera - am i doing something wrong?
glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glLoadIdentity (); GLKMatrix4MakeLookAt(10, 10, 10, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0); glPushMatrix();
// draw the cube
Any advice? Any help is hugely appreciated as well as any additional approaches to manipulating perspectives or rotating stuff in OpenGL or code examples of how to do this
Thanks a lot for any feedback you guys might give.