2
Contributors
7
Replies
10
Views
7 Years
Discussion Span
Last Post by daniel955
0

Could have something to do with depth.

Lets see some source code and then I'll be able to help you out more.

0

this the code of my opengl cube, depth test is enabled

private void Display()
        {
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glLoadIdentity();
          
            Gl.glRotated(_xAngle, 1, 0, 0);
            Gl.glRotated(_yAngle, 0, 1, 0);
            Gl.glRotated(_zAngle, 0, 0, 1);
           
            Gl.glBegin(Gl.GL_QUADS);
            //front
            Gl.glColor3d(1,0,0);
            Gl.glVertex3d(0.75,0.75,-0.75);
            Gl.glVertex3d(-0.75, 0.75, -0.75);
            Gl.glVertex3d(-0.75, -0.75, -0.75);
            Gl.glVertex3d(0.75, -0.75, -0.75);
            //right
            Gl.glColor3d(0, 1, 0);
            Gl.glVertex3d(0.75, 0.75, 0.75);
            Gl.glVertex3d(0.75, 0.75, -0.75);
            Gl.glVertex3d(0.75, -0.75, -0.75);
            Gl.glVertex3d(0.75, -0.75, 0.75);
            //left
            Gl.glColor3d(0, 0, 1);
            Gl.glVertex3d(-0.75, 0.75, 0.75);
            Gl.glVertex3d(-0.75, 0.75, -0.75);
            Gl.glVertex3d(-0.75, -0.75, -0.75);
            Gl.glVertex3d(-0.75, -0.75, 0.75);
            //back
            Gl.glColor3d(1, 1, 1);
            Gl.glVertex3d(-0.75, 0.75, 0.75);
            Gl.glVertex3d(0.75, 0.75, 0.75);
            Gl.glVertex3d(0.75, -0.75, 0.75);
            Gl.glVertex3d(-0.75, -0.75, 0.75);
            //top
            Gl.glColor3d(1, 1, 0);
            Gl.glVertex3d(0.75, 0.75, 0.75);
            Gl.glVertex3d(-0.75, 0.75, 0.75);
            Gl.glVertex3d(-0.75, 0.75, -0.75);
            Gl.glVertex3d(0.75, 0.75, -0.75);
            //bottom
            Gl.glColor3d(0, 1, 1);
            Gl.glVertex3d(0.75, -0.75, -0.75);
            Gl.glVertex3d(-0.75, -0.75, -0.75);
            Gl.glVertex3d(-0.75, -0.75, 0.75);
            Gl.glVertex3d(0.75, -0.75, 0.75);
            Gl.glEnd();

            Gl.glFlush();
            Glut.glutSwapBuffers();
        }

Edited by daniel955: n/a

0

I'm thinking that there is some kind of wall, like a limit.

is there a way to increase the space or do I really have to make it smaller?

1

Move the camera back by translating (0,0,-10) units in matrix mode projection.

I know the basics of setting up OpenGL stuff but it looks like you are using java where I know it in C++.

0

it looks like java but I'm really using C#, Taoframework OpenGL and FreeGlut.

Does matrixmode - projection mean that I'm moving the camera?

Edited by daniel955: n/a

1

Yeah any translations/rotations done in projection modifies the camera and in modelview you are moving the objects.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.