Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mr.Light

Pages: [1]
1
Graphics / Disappearing triangle
« on: April 29, 2011, 09:31:36 pm »
Fixed.

Forgot to add this stuff.

Code: [Select]

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

2
Graphics / Disappearing triangle
« on: April 28, 2011, 11:59:51 pm »
I am trying to draw a triangle which is translated 6 units into the screen. The program runs but I cannot see the triangle. I can only see the triangle if I translate less then or equal to ±1 along the z axis.

Why can't I see it when I try to translate it -6 units in the z direction?

Here is the code

Code: [Select]

#include <SFML/Graphics.hpp>

int DrawGLScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glLoadIdentity();
glTranslatef(0.0f,0.0f, -6.0f);

glBegin(GL_TRIANGLES);

glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd();

}

...


Pages: [1]