Changes in new-game.cpp [8d5e67b:cf2d1e5] in opengl-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
r8d5e67b rcf2d1e5 748 748 obj.selected_colors = { 0.0f }; 749 749 750 T_model = translate(mat4(), vec3(0.0f, -1.2f, 1.8f));750 T_model = translate(mat4(), vec3(0.0f, -1.2f, 0.0f)); 751 751 R_model = rotate(mat4(), 20.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 0.0f, 0.0f)); 752 752 R_model = mat4(); 753 obj.model_base = T_model * R_model * scale(mat4(), vec3(0. 1f, 0.1f, 0.1f));753 obj.model_base = T_model * R_model * scale(mat4(), vec3(0.3f, 0.3f, 0.3f)); 754 754 755 755 addObjectToScene(obj); 756 756 757 spawnAsteroid(vec3(0.0f, -1.2f, - 21.5f), color_sp);758 spawnAsteroid(vec3(1.0f, -1.2f, - 21.5f), color_sp);759 spawnAsteroid(vec3(-0.5f, - 1.2f, -20.8f), color_sp);757 spawnAsteroid(vec3(0.0f, -1.2f, -11.5f), color_sp); 758 spawnAsteroid(vec3(1.0f, -1.2f, -11.5f), color_sp); 759 spawnAsteroid(vec3(-0.5f, -0.7f, -10.8f), color_sp); 760 760 761 761 vector<SceneObject>::iterator obj_it; … … 827 827 //cam_pos = vec3(-2.1f, -1.5f, -1.5f); // Good position for checking ship faces 828 828 float cam_yaw = 0.0f * 2.0f * 3.14159f / 360.0f; 829 float cam_pitch = -50.0f * 2.0f * 3.14159f / 360.0f;829 float cam_pitch = 0.0f * 2.0f * 3.14159f / 360.0f; 830 830 831 831 mat4 T = translate(mat4(), vec3(-cam_pos.x, -cam_pos.y, -cam_pos.z)); 832 mat4 yaw_mat = rotate(mat4(), -cam_yaw, vec3(0.0f, 1.0f, 0.0f)); 833 mat4 pitch_mat = rotate(mat4(), -cam_pitch, vec3(1.0f, 0.0f, 0.0f)); 834 mat4 R = pitch_mat * yaw_mat; 832 mat4 R = mat4(); 835 833 view_mat = R*T; 836 834 … … 966 964 967 965 if (key_pressed[GLFW_KEY_DOWN]) { 968 transformObject(objects[1], translate(mat4(), vec3(0.0f, 0.0f, 0. 03f)), ubo);966 transformObject(objects[1], translate(mat4(), vec3(0.0f, 0.0f, 0.17f)), ubo); 969 967 transformObject(objects[2], translate(mat4(), vec3(0.0f, 0.0f, 0.06f)), ubo); 970 transformObject(objects[3], translate(mat4(), vec3(0.0f, 0.0f, 0. 04f)), ubo);968 transformObject(objects[3], translate(mat4(), vec3(0.0f, 0.0f, 0.11f)), ubo); 971 969 } 972 970 } … … 1663 1661 mat4 T = translate(mat4(), pos); 1664 1662 mat4 R = rotate(mat4(), 60.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 1.0f, -1.0f)); 1665 obj.model_base = T * R * scale(mat4(), vec3(0. 1f, 0.1f, 0.1f));1663 obj.model_base = T * R * scale(mat4(), vec3(0.2f, 0.2f, 0.2f)); 1666 1664 1667 1665 addObjectToScene(obj);
Note:
See TracChangeset
for help on using the changeset viewer.