[size="5"](SOURCE INCLUDED @ LAST POST)
INTRODUCTION
I've begun work on a 3D OpenGL isometric game engine. Lately I've attempted two things:
1) Texturing a Cube with a .BMP
2) Setting up an Isometric View
PROBLEM
I found the code for the isometric view on GameDev.net and the code for the texturing here. When using the two snippets separately, they work. When using them together, they don't and look like like this:
As you can see, it is textured properly, yet it's not isometric. I think this is due to the isometric code messing up the view.
Here is the isometric code that I put in my init() function:
void init()
{
glClearColor(0.0, 0.0, 0.0, 1.0); //RGB + Alpha
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45, 640 / 480, 1.0, 500.0); //sets camera params
glMatrixMode(GL_MODELVIEW);
SDL_WM_SetCaption( "OpenGL Game", NULL );
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
// ISOMETRIC VIEW CODE
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-100.0f, 100.0f, -100.0f, 100.0f, -500.0f, 500.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(35.264f, 1.0f, 0.0f, 0.0f);
glRotatef(-45.0f, 0.0f, 1.0f, 0.0f);
glScalef(1.0f, 1.0f, -1.0f);
Image* image = loadBMP("vtr.bmp");
_textureId = loadTexture(image);
delete image;
}
When I take out the isometric code part it works perfectly, but isn't isometric (this is just some extra coloring stuff I did too, it won't affect the texturing):
CONCLUSION
I need to figure out how to make my objects show up isometrically while also allowing me to use textures. Do any of you know any isometric code that would work to set up an isometric camera? I've tried a couple of codes from different people without success.