Saturn with Ring.

master
sigonasr2 1 year ago
parent 1aa67c5f15
commit bb8439b513
  1. 13
      LoadingModels/main.cpp
  2. BIN
      LoadingModels/saturn.jpg

@ -28,7 +28,7 @@ std::stack<glm::mat4>transforms;
GLuint pyrTex;
Sphere sphere(48);
Torus torus(0.5,0.2,48);
Torus torus(1.9,0.4,48);
void setupVertices(void) {
glGenVertexArrays(1, vao);
@ -99,7 +99,7 @@ void setupVertices(void) {
}
void setupTextures(){
pyrTex=utils::loadTexture("earth.jpg");
pyrTex=utils::loadTexture("saturn.jpg");
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D,pyrTex);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
@ -171,7 +171,14 @@ void display(GLFWwindow* window, double currentTime) {
mMat=glm::translate(glm::mat4(1.0f),{0.f,0.f,0.f});
mMat=glm::rotate(mMat,float(currentTime/4),{0.f,1.f,0.4f});
mMat=glm::scale(mMat,{5,5,5});
mMat=glm::scale(mMat,{3,3,3});
mvMat=vMat*mMat;
DrawSphere();
mMat=glm::translate(glm::mat4(1.0f),{0.f,0.f,0.f});
mMat=glm::rotate(mMat,float(currentTime/4),{0.f,1.f,0.4f});
mMat=glm::scale(mMat,{3,0.1,3});
mvMat=vMat*mMat;
DrawTorus();

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Loading…
Cancel
Save