Changeset 8d5e67b in opengl-game for new-game.cpp
- Timestamp:
- Jun 15, 2018, 1:25:34 AM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- c9af90a
- Parents:
- cf2d1e5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
rcf2d1e5 r8d5e67b 748 748 obj.selected_colors = { 0.0f }; 749 749 750 T_model = translate(mat4(), vec3(0.0f, -1.2f, 0.0f));750 T_model = translate(mat4(), vec3(0.0f, -1.2f, 1.8f)); 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. 3f, 0.3f, 0.3f));753 obj.model_base = T_model * R_model * scale(mat4(), vec3(0.1f, 0.1f, 0.1f)); 754 754 755 755 addObjectToScene(obj); 756 756 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);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); 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 = 0.0f * 2.0f * 3.14159f / 360.0f;829 float cam_pitch = -50.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 R = mat4(); 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; 833 835 view_mat = R*T; 834 836 … … 964 966 965 967 if (key_pressed[GLFW_KEY_DOWN]) { 966 transformObject(objects[1], translate(mat4(), vec3(0.0f, 0.0f, 0. 17f)), ubo);968 transformObject(objects[1], translate(mat4(), vec3(0.0f, 0.0f, 0.03f)), ubo); 967 969 transformObject(objects[2], translate(mat4(), vec3(0.0f, 0.0f, 0.06f)), ubo); 968 transformObject(objects[3], translate(mat4(), vec3(0.0f, 0.0f, 0. 11f)), ubo);970 transformObject(objects[3], translate(mat4(), vec3(0.0f, 0.0f, 0.04f)), ubo); 969 971 } 970 972 } … … 1661 1663 mat4 T = translate(mat4(), pos); 1662 1664 mat4 R = rotate(mat4(), 60.0f * (float)ONE_DEG_IN_RAD, vec3(1.0f, 1.0f, -1.0f)); 1663 obj.model_base = T * R * scale(mat4(), vec3(0. 2f, 0.2f, 0.2f));1665 obj.model_base = T * R * scale(mat4(), vec3(0.1f, 0.1f, 0.1f)); 1664 1666 1665 1667 addObjectToScene(obj);
Note:
See TracChangeset
for help on using the changeset viewer.