princetonpku / hccl-archive

Automatically exported from code.google.com/p/hccl-archive
0 stars 0 forks source link

Quaternion에서 constructor추가 #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
아래 세 항목들을 추가해주시면 되겠습니다.

---
Axis-angle로부터 quaternion을 생성하는 생성자
Quaterniond(double angle, const Vector3d& axis);

rotation matrix로부터 quaternion을 생성하는 생성자
Quaterniond(const double* matrix);

Euler angle로부터 quaternion을 생성하는 생성자
Quaterniond(double a, double b, double c, const char* order);

---

이 때 주의하실 점은,
1. rotation matrix는 3x3 column-stacked matrix임. 즉 M_{i,j} ==> M[j*3 + i]
2. Euler angle에서 char* order는 Euler angle의 순서를 나타냄. 즉 
order == "xyz" 이거나 order == "XYZ" 일 경우 X-Y-Z Euler angle이며, 
order == "ZYZ" 혹은 order == "zyz" 일 경우 Z-Y-Z Euler angle을 나타냄.
3. 상기 모든 경우는 QuaternionAlgebra에 이미 구현되어 있으며, 
이를 단순히 Quaterniond 클래스 wrapper를 통해 interface만 
제공해주면 되는 것임. 즉 내부 알고리즘을 새로 구현할 
필요는 없음. 멤버함수 내에서 QuaternionAlgebra 내의 함수를 
호출하는 방식으로 작성.
4. Quaterniond뿐만 아니라 Quaternionf에서도 위 내용을 동일하게 
float버전으로 작성

Original issue reported on code.google.com by mec...@gmail.com on 24 Jul 2012 at 9:34

GoogleCodeExporter commented 9 years ago
제가 오늘 안으로 구현해 놓겠음

Original comment by hounh...@gmail.com on 24 Jul 2012 at 9:46

GoogleCodeExporter commented 9 years ago
임정훈님 짱!

Original comment by mec...@gmail.com on 27 Jul 2012 at 2:09