c++ Programming Glossary: glmatrixmode
true isometric projection with opengl http://stackoverflow.com/questions/1059200/true-isometric-projection-with-opengl glClearColor 0.0 0.0 0.0 1.0 glClear GL_COLOR_BUFFER_BIT glMatrixMode GL_PROJECTION glLoadIdentity use this length so that camera.. camera is pointing at 0.0 1.0 0.0 which direction is up glMatrixMode GL_MODELVIEW glBegin GL_LINES glColor3d 1.0 0.0 0.0 glVertex3d..
object loader in opengl http://stackoverflow.com/questions/14887012/object-loader-in-opengl display glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT glMatrixMode GL_PROJECTION glLoadIdentity double w glutGet GLUT_WINDOW_WIDTH.. w 2 curTrans.y h 2 0 gluPerspective 60 ar 0.1 100 glMatrixMode GL_MODELVIEW glLoadIdentity glTranslatef 0 0 10 glPushMatrix.. glEnable GL_LIGHTING glEnable GL_LIGHT0 glMatrixMode GL_MODELVIEW glLoadIdentity GLfloat position 0 0 1 0 glLightfv..
C++ OpenGL window only tracks background http://stackoverflow.com/questions/18477852/c-opengl-window-only-tracks-background 0 0 GLsizei w GLsizei h Set matrix mode to projection. glMatrixMode GL_PROJECTION Clear current projection matrix to identity. glLoadIdentity.. 0.0 100.0 0.0 100.0 1.0 1.0 Set matrix mode to modelview. glMatrixMode GL_MODELVIEW Clear current modelview matrix to identity. glLoadIdentity..
OpenGL and GLUT in Eclipse on OS X http://stackoverflow.com/questions/2068693/opengl-and-glut-in-eclipse-on-os-x GL_Setup int width int height glViewport 0 0 width height glMatrixMode GL_PROJECTION glEnable GL_DEPTH_TEST gluPerspective 45 float.. GL_DEPTH_TEST gluPerspective 45 float width height .1 100 glMatrixMode GL_MODELVIEW Initialize GLUT and start main loop int main int..
opengl texturing http://stackoverflow.com/questions/5380717/opengl-texturing void glClearColor 0.0 0.0 0.0 0.0 glEnable GL_DEPTH_TEST glMatrixMode GL_MODELVIEW is_depth 1 void display void if is_depth glClear.. void resize int width int height if height 0 height 1 glMatrixMode GL_PROJECTION glLoadIdentity gluPerspective 45.0 width height.. 45.0 width height 1.0 400.0 glTranslatef 0.0 5.0 150.0 glMatrixMode GL_MODELVIEW void drawcube float xc float yc float zc float..
Creating a 3D sphere in Opengl using Visual C++ http://stackoverflow.com/questions/5988686/creating-a-3d-sphere-in-opengl-using-visual-c myInit glClearColor 1.0 1.0 1.0 1.0 glColor3f 1.0 0.0 0.0 glMatrixMode GL_PROJECTION glLoadIdentity gluOrtho2D 0.0 499.0 0.0 499.0.. glLoadIdentity gluOrtho2D 0.0 499.0 0.0 499.0 glMatrixMode GL_MODELVIEW void main int argc char argv qobj gluNewQuadric.. i r 1 sectors s void draw GLfloat x GLfloat y GLfloat z glMatrixMode GL_MODELVIEW glPushMatrix glTranslatef x y z glEnableClientState..
Image scaling (KeepAspectRatioByExpanding) through OpenGL http://stackoverflow.com/questions/9011108/image-scaling-keepaspectratiobyexpanding-through-opengl .5f offset_y 1 2 gl_height .5f center on screen break glMatrixMode GL_PROJECTION glLoadIdentity glMatrixMode GL_MODELVIEW glLoadIdentity.. on screen break glMatrixMode GL_PROJECTION glLoadIdentity glMatrixMode GL_MODELVIEW glLoadIdentity just simple ortho view no fancy.. 0 orig_height gl_height .5f center on screen break glMatrixMode GL_PROJECTION glLoadIdentity glMatrixMode GL_MODELVIEW glLoadIdentity..
|