Skip to content

Commit

Permalink
flight me up baby
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousSamV committed Jan 22, 2017
1 parent 86e290d commit 5a7fead
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/01_app",
"program": "${workspaceRoot}/build/app_06.app",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
Expand Down
2 changes: 1 addition & 1 deletion 04/04.fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ void main()
color = mix(
texture(ourTexture1, texCoord),
texture(ourTexture2, texCoord),
0.2 // 0.0 - arg[0], 1.0 - arg[1]
0.3 // 0.0 - arg[0], 1.0 - arg[1]
);
}
28 changes: 13 additions & 15 deletions 05/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,17 @@ GLfloat vertices[] = {
};

glm::vec3 cubePos[] = {
glm::vec3(0.0f, 0.0f, 0.0f), //1
glm::vec3(2.0f, 5.0f, 15.0f), //2
glm::vec3(7.0f, -4.0f, -15.0f), //3
glm::vec3(6.0f, -9.0f, 0.0f), //4
glm::vec3(2.6f, 5.0f, -9.0f), //5
glm::vec3(0.0f, 7.0f, 0.0f), //6
glm::vec3(-9.0f, 0.0f, 0.0f), //7
glm::vec3(-15.0f, 0.0f, 0.0f), //8
glm::vec3(5.0f, 0.0f, 0.0f), //9
glm::vec3(0.0f, 0.0f, 0.0f), //10
glm::vec3(5.0f, -15.0f, 0.0f), //11
glm::vec3(0.0f, 0.0f, 0.0f), //12
glm::vec3(0.0f, 50.0f, 5.0f), //13
glm::vec3( 0.0f, 0.0f, 0.0f),
glm::vec3( 2.0f, 5.0f, -15.0f),
glm::vec3(-1.5f, -2.2f, -2.5f),
glm::vec3(-3.8f, -2.0f, -12.3f),
glm::vec3( 2.4f, -0.4f, -3.5f),
glm::vec3(-1.7f, 3.0f, -7.5f),
glm::vec3( 1.3f, -2.0f, -2.5f),
glm::vec3( 1.5f, 2.0f, -2.5f),
glm::vec3( 1.5f, 0.2f, -1.5f),
glm::vec3(-1.3f, 1.0f, -1.5f)

};

class myApp: public mylib::App
Expand Down Expand Up @@ -251,9 +249,9 @@ class myApp: public mylib::App
glBindTexture(GL_TEXTURE_2D, texture[1]);
glUniform1i(glGetUniformLocation(shader.program, "ourTexture2"), 1);

for (GLuint i = 0; i < 13; ++i) {
for (GLuint i = 0; i < 10; ++i) {
model = glm::translate(glm::mat4(), cubePos[i]);
model = glm::rotate(model, 20.0f * i, glm::vec3(1.0f, 0.3f, 0.5f));
model = glm::rotate(model, glm::radians(20.0f * i), glm::vec3(1.0f, 0.3f, 0.5f));
glUniformMatrix4fv(
glGetUniformLocation(shader.program, "model"),
1, GL_FALSE, glm::value_ptr(model)
Expand Down
Loading

0 comments on commit 5a7fead

Please sign in to comment.