Skip to content

Commit 0f17304

Browse files
authored
Merge pull request #44 from iwatake2222/feature-#42-update_document_2
Fix terms in code and document. Issue #42
2 parents e1d04d9 + bf9ff65 commit 0f17304

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
![image](https://user-images.githubusercontent.com/11009876/148989308-2d9c70b0-d25e-4124-b109-2fcb03c8ebb9.png)
1+
![image](https://user-images.githubusercontent.com/11009876/148997642-8a54899a-8547-44a8-a211-b7d8f4b9b063.png)
22

33
# Rotation Master
4-
- Provide conversion between the following representations of 3D rotation (rigid body orientation) and display the pose
4+
- Provide conversion between the following representations of 3D rotation and display a rigid body orientation
55
- Rotation Matrix
66
- Rotation Vector
77
- Axis-angle
88
- Quaternion
9-
- Euler Angle (Intrinsic; Mobile)
10-
- Euler Angle (Extrinsic; Fixed)
9+
- Euler Angles (Intrinsic; Mobile)
10+
- Euler Angles (Extrinsic; Fixed)
1111

1212
https://user-images.githubusercontent.com/11009876/148988739-5f775a11-c923-4557-aff7-12b9a4811d36.mp4
1313

desktop/container.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class SettingContainer {
135135
is_dark_mode = true;
136136
is_draw_ground = true;
137137
is_view_from_axis = true;
138-
is_go_around = true;
138+
is_camera_revolution = true;
139139
is_normalize_rotation_matrix = true;
140140
is_update_input_pressed = false;
141141
is_reset_view_pressed = false;
@@ -147,7 +147,7 @@ class SettingContainer {
147147
bool is_dark_mode;
148148
bool is_draw_ground;
149149
bool is_view_from_axis;
150-
bool is_go_around;
150+
bool is_camera_revolution;
151151
bool is_normalize_rotation_matrix;
152152
bool is_update_input_pressed;
153153
bool is_reset_view_pressed;

desktop/gl_helper/window.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ void Window::SetIsDarkMode(bool is_darkmode)
9898
m_is_darkmode = is_darkmode;
9999
}
100100

101-
void Window::SetIsGoAround(bool is_go_around)
101+
void Window::SetIsCameraRevolution(bool is_camera_revolution)
102102
{
103-
m_is_go_around = is_go_around;
103+
m_is_camera_revolution = is_camera_revolution;
104104
}
105105

106106
Matrix Window::GetViewProjectionFromAxisX(float cx, float cy, float fovy, float z_near, float z_far)
@@ -245,7 +245,7 @@ bool Window::FrameStart()
245245
m_last_mouse_y = mouse_y;
246246

247247
if (glfwGetMouseButton(m_window, GLFW_MOUSE_BUTTON_2) != GLFW_RELEASE) {
248-
if (!m_is_go_around) {
248+
if (!m_is_camera_revolution) {
249249
m_camera_angle[1] += mouse_move_x * MOUSE_ROT_SPEED;
250250
m_camera_angle[0] += mouse_move_y * MOUSE_ROT_SPEED;
251251
} else{
@@ -265,7 +265,7 @@ bool Window::FrameStart()
265265
LookAt({ m_camera_pos[0], m_camera_pos[1], m_camera_pos[2] }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f });
266266
}
267267
}
268-
if (!m_is_go_around && glfwGetMouseButton(m_window, GLFW_MOUSE_BUTTON_3) != GLFW_RELEASE) {
268+
if (!m_is_camera_revolution && glfwGetMouseButton(m_window, GLFW_MOUSE_BUTTON_3) != GLFW_RELEASE) {
269269
//m_camera_pos[0] -= mouse_move_x * MOUSE_MOV_SPEED;
270270
//m_camera_pos[1] -= -mouse_move_y * MOUSE_MOV_SPEED;
271271
float dx_in_camera_cord = -mouse_move_x * MOUSE_MOV_SPEED;

desktop/gl_helper/window.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Window
4747

4848
GLFWwindow* GetWindow();
4949
void SetIsDarkMode(bool);
50-
void SetIsGoAround(bool);
50+
void SetIsCameraRevolution(bool);
5151
int32_t GetWidth();
5252
int32_t GetHeight();
5353

@@ -66,7 +66,7 @@ class Window
6666
double m_last_mouse_y;
6767

6868
bool m_is_darkmode;
69-
bool m_is_go_around;
69+
bool m_is_camera_revolution;
7070
};
7171

7272

desktop/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ int main(int argc, char *argv[])
192192
}
193193

194194
my_window.SetIsDarkMode(setting_container.is_dark_mode);
195-
my_window.SetIsGoAround(setting_container.is_go_around);
195+
my_window.SetIsCameraRevolution(setting_container.is_camera_revolution);
196196

197197
/* Update display */
198198
my_window.SwapBuffers();

desktop/ui.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void Ui::Update(Window& window, AngleUnit& angle_unit, InputContainer& input_con
147147
}
148148
ImGui::Separator();
149149

150-
ImGui::RadioButton("Euler Angle (Intrinsic; Mobile)", &input_container.selected_representation_type, static_cast<int32_t>(REPRESENTATION_TYPE::EULER_MOBILE));
151-
if (ImGui::BeginTable("Euler Angle (Intrinsic; Mobile)", 4)) {
150+
ImGui::RadioButton("Euler Angles (Intrinsic; Mobile)", &input_container.selected_representation_type, static_cast<int32_t>(REPRESENTATION_TYPE::EULER_MOBILE));
151+
if (ImGui::BeginTable("Euler Angles (Intrinsic; Mobile)", 4)) {
152152
bool is_value_changed = false;
153153
float val[3] = { angle_unit.Display(input_container.mobile_euler_angle[0]), angle_unit.Display(input_container.mobile_euler_angle[1]), angle_unit.Display(input_container.mobile_euler_angle[2]) };
154154
ImGui::TableNextRow();
@@ -164,8 +164,8 @@ void Ui::Update(Window& window, AngleUnit& angle_unit, InputContainer& input_con
164164
}
165165
ImGui::Separator();
166166

167-
ImGui::RadioButton("Euler Angle (Extrinsic; Fixed)", &input_container.selected_representation_type, static_cast<int32_t>(REPRESENTATION_TYPE::EULER_FIXED));
168-
if (ImGui::BeginTable("Euler Angle (Extrinsic; Fixed)", 4)) {
167+
ImGui::RadioButton("Euler Angles (Extrinsic; Fixed)", &input_container.selected_representation_type, static_cast<int32_t>(REPRESENTATION_TYPE::EULER_FIXED));
168+
if (ImGui::BeginTable("Euler Angles (Extrinsic; Fixed)", 4)) {
169169
bool is_value_changed = false;
170170
float val[3] = { angle_unit.Display(input_container.fixed_euler_angle[0]), angle_unit.Display(input_container.fixed_euler_angle[1]), angle_unit.Display(input_container.fixed_euler_angle[2]) };
171171
ImGui::TableNextRow();
@@ -230,8 +230,8 @@ void Ui::Update(Window& window, AngleUnit& angle_unit, InputContainer& input_con
230230
}
231231
ImGui::Separator();
232232

233-
ImGui::Text("Euler Angle (Intrinsic; Mobile)");
234-
if (ImGui::BeginTable("Euler Angle (Intrinsic; Mobile)", 4)) {
233+
ImGui::Text("Euler Angles (Intrinsic; Mobile)");
234+
if (ImGui::BeginTable("Euler Angles (Intrinsic; Mobile)", 4)) {
235235
for (int32_t i = 0; i < static_cast<int32_t>(sizeof(EULER_ORDER_STR) / sizeof(char*)); i++) {
236236
ImGui::TableNextRow();
237237
ImGui::TableSetColumnIndex(0); ImGui::Text("%s", EULER_ORDER_STR[i]);
@@ -244,8 +244,8 @@ void Ui::Update(Window& window, AngleUnit& angle_unit, InputContainer& input_con
244244
}
245245
ImGui::Separator();
246246

247-
ImGui::Text("Euler Angle (Extrinsic; Fixed)");
248-
if (ImGui::BeginTable("Euler Angle (Extrinsic; Fixed)", 4)) {
247+
ImGui::Text("Euler Angles (Extrinsic; Fixed)");
248+
if (ImGui::BeginTable("Euler Angles (Extrinsic; Fixed)", 4)) {
249249
for (int32_t i = 0; i < static_cast<int32_t>(sizeof(EULER_ORDER_STR) / sizeof(char*)); i++) {
250250
ImGui::TableNextRow();
251251
ImGui::TableSetColumnIndex(0); ImGui::Text("%s", EULER_ORDER_STR[i]);
@@ -292,11 +292,11 @@ void Ui::Update(Window& window, AngleUnit& angle_unit, InputContainer& input_con
292292
ImGui::RadioButton("Degrees", &radio_degree, 1);
293293
angle_unit.is_degree = (radio_degree == 1);
294294

295-
int32_t go_around = setting_container.is_go_around ? 1 : 0;
296-
ImGui::Text("Move:"); ImGui::SameLine();
297-
ImGui::RadioButton("GoAround", &go_around, 1); ImGui::SameLine();
298-
ImGui::RadioButton("Free", &go_around, 0);
299-
setting_container.is_go_around = (go_around == 1);
295+
int32_t is_revolution = setting_container.is_camera_revolution ? 1 : 0;
296+
ImGui::Text("Camera:"); ImGui::SameLine();
297+
ImGui::RadioButton("Revolution", &is_revolution, 1); ImGui::SameLine();
298+
ImGui::RadioButton("Free", &is_revolution, 0);
299+
setting_container.is_camera_revolution = (is_revolution == 1);
300300

301301
int32_t is_normalize_rotation_matrix = setting_container.is_normalize_rotation_matrix ? 1 : 0;
302302
ImGui::Text("Normalize Rotation Matrix:"); ImGui::SameLine();

0 commit comments

Comments
 (0)