   Displaying 3D objects in ortho mode?
  Well, I''m making a menu in my game that has the name, the 2D menu itself, and, the 3D model in front of the menu, based on the screen positions.Now, I tried, in ortho mode, displaying the model, but its not working...can ne1 help me? thx 
  You need to give more information.For a first guess, what are you setting your Z-buffer near and far values at when you set your orthographic projection matrix? If your object is outside this it won''t be drawn.   Why you shouldn''t use iostream.h - ever! | A Good free online C++ book;  Ok, this is the code that I have: void DrawModel2D(int X,int Y,t3DModel Model,int SCALE){    glMatrixMode(GL_PROJECTION);    glPushMatrix();  glLoadIdentity();glOrtho(0,Resolution_X,Resolution_Y,0,500,-500);glMatrixMode(GL_MODELVIEW);   glPushMatrix(); glLoadIdentity();  glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);glDisable(GL_DITHER);   glShadeModel(GL_FLAT);  glEnable(GL_TEXTURE_2D);    glEnable(GL_DEPTH_TEST);    glTranslatef(X,Y,0);    glMatrixMode(GL_PROJECTION);    DrawModel(Model,X,Y,0,SCALE);    glDisable(GL_TEXTURE_2D);    glMatrixMode(GL_PROJECTION);    glPopMatrix();  glMatrixMode(GL_MODELVIEW);glPopMatrix();glPopAttrib();}Now, DrawModel works like this: void DrawModel(t3DModel Model,GLfloat X,GLfloat Y, GLfloat Z, int SCALE){   glPushMatrix();   glTranslatef(X,Y,Z);for(int i = 0; i < Model.numOfObjects; i++){// Make sure we have valid objects just in case. (size() is in the vector class)if(Model.pObject.size() <= 0) break;// Get the current object that we are displayingt3DObject *pObject = &Model.pObject[i];// Check to see if this object has a texture map, if so bind the texture to it.if(pObject->bHasTexture) {// Turn on texture mapping and turn off colorglEnable(GL_TEXTURE_2D);// Reset the color to normal againglColor3ub(255, 255, 255);// Bind the texture map to the object by it''s materialIDglBindTexture(GL_TEXTURE_2D, Model.pMaterials[ pObject->materialID ].texureId);//materialID);} else {// Turn off texture mapping and turn on colorglDisable(GL_TEXTURE_2D);// Reset the color to normal againglColor3ub(255, 255, 255);} // This determines if we are in wireframe or normal modeglBegin(GL_TRIANGLES);// Begin drawing with our selected mode (triangles or lines)// Go through all of the faces (polygons) of the object and draw themfor(int j = 0; j < pObject->numOfFaces; j++){// Go through each corner of the triangle and draw it.for(int whichVertex = 0; whichVertex < 3; whichVertex++){// Get the index for each point of the faceint index = pObject->pFaces[j].vertIndex[whichVertex];// Give OpenGL the normal for this vertex.   glNormal3f(pObject->pNormals[ index ].x, pObject->pNormals[ index ].y, pObject->pNormals[ index ].z);// If the object has a texture associated with it, give it a texture coordinate.if(pObject->bHasTexture) {// Make sure there was a UVW map applied to the object or else it won''t have tex coords.if(pObject->pTexVerts) {glTexCoord2f(pObject->pTexVerts[ index ].x, pObject->pTexVerts[ index ].y);}} else {// Make sure there is a valid material/color assigned to this object.// You should always at least assign a material color to an object,// but just in case we want to check the size of the material list.// if the size is at least one, and the material ID != -1,// then we have a valid material.if(Model.pMaterials.size() && pObject->materialID >= 0){// Get and set the color that the object is, since it must not have a texture BYTE *pColor = Model.pMaterials[pObject->materialID].color;// Assign the current color to this modelglColor3ub(pColor[0], pColor[1], pColor[2]);}}// Pass in the current vertex of the object (Corner of current face)glVertex3f(pObject->pVerts[ index ].x/SCALE, pObject->pVerts[ index ].y/SCALE, pObject->pVerts[ index ].z/SCALE);}}glEnd();}glPopMatrix();}DrawModel is working on the main map.. but not when I try drawing it in glOrthoMode...  ;  BUMP ;  ortho mode is for 2d graphics only. You cant draw a 3d model in 2d mode. Ortho mode will not display anything that has a z value other than 0 (or is it 1? i forget). You will have to draw the 3d model after you pop your ortho mode matrix. ;quote:Original post by santonel  ortho mode is for 2d graphics only. You cant draw a 3d model in 2d mode. Ortho mode will not display anything that has a z value other than 0 (or is it 1? i forget). You will have to draw the 3d model after you pop your ortho mode matrix.   Sorry, but you''re wrong on that one. The last two params of glOrtho are the near & far clipping plane values. They determine which z-values are discarded. So it''s perfectly possible to render 3D-models in ortho mode. It will look different of course, because no perspective is applied to the renderd primitives. ;  I stand corrected. ;  I didn''t really look through your code, but I saw one thing you can try...changeglOrtho(0,Resolution_X,Resolution_Y,0,500,-500);toglOrtho(0,Resolution_X,0,Resolution_Y,-500,500);   ---General Programmer at Wildfire Gamesworking on the 0 A.D. project;quote:Original post by skullfire  glMatrixMode(GL_PROJECTION);DrawModel(Model,X,Y,0,SCALE);*cough* NEVER do anything in projection mode except setting up the projection matrix. your drawmodel will apply transformations, screw up the projection matrix and it would be a small wonder if you could see anything.and keep your order in glortho if you want to think in screen coords (where y=0 is the top of the screen). though id probably not use such extreme z-values.