PDA

View Full Version : Drawing Sphere in Cocoa OpenGL




hoschi
Oct 20, 2005, 07:56 PM
Wonder how to draw a sphere which I can center anywhere in the window and not just centered at the origin..

Thanks in advance



Artful Dodger
Oct 20, 2005, 09:34 PM
One like this? sorry didn't see the cocoa part, my bad :o

hoschi
Oct 21, 2005, 10:03 AM
One like this? sorry didn't see the cocoa part, my bad :o
right.. something like that...

HiRez
Oct 21, 2005, 11:26 AM
Wonder how to draw a sphere which I can center anywhere in the window and not just centered at the origin.You can apply a translation transformation to move the sphere away from the origin, or change the view matrix (IOW, move the camera off-center so it's not looking directly at a sphere at the origin). Not sure if you're asking something different because you did mention "Cocoa OpenGL" specifically, but for most things it's the same as any OpenGL.