Saturn with Ring.
This commit is contained in:
parent
1aa67c5f15
commit
bb8439b513
@ -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();
|
||||
|
BIN
LoadingModels/saturn.jpg
Normal file
BIN
LoadingModels/saturn.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 KiB |
Loading…
x
Reference in New Issue
Block a user