Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBrother Bob

Posted 22 July 2013 - 12:06 PM

I think that -350 should put the fish behind the rectangle if the rectangle is at -300.  Negative should be away from you and positive should be towards you. 

 

Try adding an increment variable to move things around while the render loop is running.

 

GLfloat moveFish = 0.0;

 

void RenderScene(void)

{

moveFish += 0.1;

 

   glPushMatrix();

   glColor3f(1.0f, 0.0f, 0.0f); glTranslate(0.0f, 0.0f, moveFish//This will keep moving the fish 'towards you'.

  glRotatef(-300, 0.0f, 0.0f, 1.0f);    glScalef(0.3, 0.3, 0.3);    glEnable(GL_TEXTURE_2D);   glBindTexture (GL_TEXTURE_2D,texId1);   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);    glCallList(displayList1);   glDisable(GL_TEXTURE_2D);  glPopMatrix();

}

//=======================================================================================

And also, I see that you are still using gigantic numbers for the Z positions.  Again, try setting the Z's to something at little more reasonable like 1 or 2 for now.  I can't make any sense of why you would use numbers like 300 and 350???  The rectangle is less than 2 units wide and 1 unit high. 


#4marcClintDion

Posted 22 July 2013 - 03:11 AM

There is far too much arrogance and out right abuse by site moderators, they are teaching other people to behave this way.  The posts I've made will all be shorty removed and replaced with this notice.  Game development is not the only thing being taught here, bad behavior is being taught as well.


#3marcClintDion

Posted 01 July 2013 - 10:35 PM

I think that -350 should put the fish behind the rectangle if the rectangle is at -300.  Negative should be away from you and positive should be towards you. 

 

Try adding an increment variable to move things around while the render loop is running.

 

GLfloat moveFish = 0.0;

 

void RenderScene(void)

{

   moveFish += 0.1;

 

   glPushMatrix();

        glColor3f(1.0f, 0.0f, 0.0f);
        glTranslate(0.0f, 0.0f, moveFish//This will keep moving the fish 'towards you'.

        glRotatef(-300, 0.0f, 0.0f, 1.0f);
        glScalef(0.3, 0.3, 0.3);
        glEnable(GL_TEXTURE_2D);
        glBindTexture (GL_TEXTURE_2D,texId1);
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
        glCallList(displayList1);
        glDisable(GL_TEXTURE_2D);
    glPopMatrix();

}

//=======================================================================================

And also, I see that you are still using gigantic numbers for the Z positions.  Again, try setting the Z's to something at little more reasonable like 1 or 2 for now.  I can't make any sense of why you would use numbers like 300 and 350???  The rectangle is less than 2 units wide and 1 unit high. 


#2marcClintDion

Posted 01 July 2013 - 10:34 PM

I think that -350 should put the fish behind the rectangle if the rectangle is at -300.  Negative should be away from you and positive should be towards you. 

 

Try adding an increment variable to move things around while the render loop is running.

 

GLfloat moveFish = 0.0;

 

void RenderScene(void)

{

   moveFish += 0.1;

 

   glPushMatrix();

        glColor3f(1.0f, 0.0f, 0.0f);
        glTranslate(0.0f, 0.0f, moveFish)

        glRotatef(-300, 0.0f, 0.0f, 1.0f);
        glScalef(0.3, 0.3, 0.3);
        glEnable(GL_TEXTURE_2D);
        glBindTexture (GL_TEXTURE_2D,texId1);
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
        glCallList(displayList1);
        glDisable(GL_TEXTURE_2D);
    glPopMatrix();

}

//=======================================================================================

And also, I see that you are still using gigantic numbers for the Z positions.  Again, try setting the Z's to something at little more reasonable like 1 or 2 for now.  I can't make any sense of why you would use numbers like 300 and 350???  The rectangle is less than 2 units wide and 1 unit high. 


#1marcClintDion

Posted 01 July 2013 - 10:29 PM

I think that -350 should put the fish behind the rectangle if the rectangle is at -300.  Negative should be away from you and positive should be towards you. 

 

Try adding an increment variable to move things around while the render loop is running.

 

GLfloat moveFish = 0.0;

 

void RenderScene(void)

{

   moveFish += 0.1;

 

   glPushMatrix();

        glColor3f(1.0f, 0.0f, 0.0f);
        glTranslate(0.0f, 0.0f, moveFish)

        glRotatef(-300.0, 0.0f, 300.0f, 50.0f);
        glScalef(0.3, 0.3, 0.3);
        glEnable(GL_TEXTURE_2D);
          glBindTexture (GL_TEXTURE_2D,texId1);
          glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
        glCallList(displayList1);
          glDisable(GL_TEXTURE_2D);
    glPopMatrix();

}


PARTNERS