Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualDarkHorseKnight

Posted 12 April 2012 - 10:15 AM

tried doing that no luck what so ever but thanks for trying Posted Image



   glBindTexture(GL_TEXTURE_2D, ModelTexture);
	  //Enable Attribute for "index 0"
	  glEnableVertexAttribArray(0);
	  //Enable Attribute for "index 1"
	  glEnableVertexAttribArray(1);
	  glBindBuffer(GL_ARRAY_BUFFER, texcoordbuffer);
      glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
	  //Model Vertices cordinates
	  glVertexAttribPointer(0, 0, GL_INT, GL_FALSE,0,0);
	  //Model Texture cordinates
	  glVertexAttribPointer(1, 0, GL_FLOAT, GL_FALSE,0,0);

  GLfloat RotationMatrix[] = {
		1.0, 0.0, 0.0, 0.0,
		0.0, 1.0, 0.0, 0.0,
		0.0, 0.0, 1.0, 0.0,
		0.0, 0.0, 0.0, 1.0
};
	  //Translation Process
	  GLfloat TranslationMatrix[] = {
		1.0, 0.0, 0.0, 0.0,
		0.0, 1.0, 0.0, 0.0,
		0.0, 0.0, 1.0, 1.0,
		0.0, 0.0, 0.0, 1.0
	  };
	  //Send Translation Matrix up to the vertex shader
	  glUniformMatrix4fv(translation, 1, TRUE, TranslationMatrix);
	
	  //Send Rotation Matrix up to the vertex shader
	  glUniformMatrix4fv(Rotation, 1, TRUE, RotationMatrix);
	  glDrawElements( GL_QUADS, faces.size(), GL_UNSIGNED_INT, reinterpret_cast<GLvoid*>(&faces[0]));
	}

#2DarkHorseKnight

Posted 12 April 2012 - 10:14 AM

tried doing that no luck what so ever but thanks for trying Posted Image



   glBindTexture(GL_TEXTURE_2D, ModelTexture);
	  //Enable Attribute for "index 0"
	  glEnableVertexAttribArray(0);
	  //Enable Attribute for "index 1"
	  glEnableVertexAttribArray(1);
	  glBindBuffer(GL_ARRAY_BUFFER, texcoordbuffer);
	  glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
	  //Model Vertices cordinates
	  glVertexAttribPointer(0, 0, GL_INT, GL_FALSE,0,0);
	  //Model Texture cordinates
	  glVertexAttribPointer(1, 0, GL_FLOAT, GL_FALSE,0,0);
		   //Translation Process
  GLfloat RotationMatrix[] = {
	    1.0, 0.0, 0.0, 0.0,
	    0.0, 1.0, 0.0, 0.0,
	    0.0, 0.0, 1.0, 0.0,
	    0.0, 0.0, 0.0, 1.0
};

	  //Translation Process
	  GLfloat TranslationMatrix[] = {
	    1.0, 0.0, 0.0, 0.0,
	    0.0, 1.0, 0.0, 0.0,
	    0.0, 0.0, 1.0, 1.0,
	    0.0, 0.0, 0.0, 1.0
	  };
	  //Send Translation Matrix up to the vertex shader
	  glUniformMatrix4fv(translation, 1, TRUE, TranslationMatrix);
	
	  //Send Rotation Matrix up to the vertex shader
	  glUniformMatrix4fv(Rotation, 1, TRUE, RotationMatrix);
	  glDrawElements( GL_QUADS, faces.size(), GL_UNSIGNED_INT, reinterpret_cast<GLvoid*>(&faces[0]));
    }

#1DarkHorseKnight

Posted 12 April 2012 - 10:10 AM

tried doing that no luck what so ever but thanks for trying :)

PARTNERS