I am making a 3d tic tac toe game, I am new to 3d games. I have drawn one game board but I want to be drawn at an oblique angle so it looks 3d. can I please get some help. I am however able to rotate it by 45 degrees.
void drawBoard_one()
{
glColor3f(1.0f, 0.0f, 0.0f);
glRotatef(45.0f, 0.0f, 0.0f, 1.0f);
glBegin(GL_LINE_STRIP);
glVertex3f(-25.0f, 75.0f, 0.0f);
glVertex3f(-25.0f, -75.0f, 0.0f);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex3f(25.0f, 75.0f, 0.0f);
glVertex3f(25.0f, -75.0f, 0.0f);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex3f(-75.0f, 25.0f, 0.0f);
glVertex3f(75.0f, 25.0f, 0.0f);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex3f(-75.0f, -25.0f, 0.0f);
glVertex3f(75.0f, -25.0f, 0.0f);
glEnd();
}
void drawBoard_two()
{
}
void drawBoard_three()
{
}
void renderScene()
{
glClear(GL_COLOR_BUFFER_BIT);
drawBoard_one();
glutSwapBuffers();
}
void ChangeSize(GLsizei w, GLsizei h)
{
GLfloat aspectRatio;
if (h == 0)
h = 1;
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
aspectRatio = (GLfloat)w / (GLfloat)h;
if (w <= h)
glOrtho(-100.0, 100.0, -100.0 / aspectRatio, 100.0 / aspectRatio, 10.0, -10.0);
else
glOrtho(-100.0*aspectRatio, 100.0*aspectRatio, -100.0, 100.0, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}