~cpp 주석을 달기 귀찮졌더습니. 그래서 지금지 단는 아까우니까 그 두고. 나머는 관기로 했음다. ㅋㅋ 대신 내용 tp로 만든거를 올겠습다. 글구 어 분이 쓰신 .. 도 께 올리도록 하지. 빠른 일 내.. -_-; 음.. 여기 파 링크 어떻게 걸쥐?? -_- - 해성
Contents</span>2>
- 1ass="dot">. The Matrix and Quaternions FAQ
- 2ass="dot">. Contents of article dt>
- 3ass="dot">. Introduction
- 4ass="dot">. Basics </a>
- 4.1class="dot">.n> Q1. What is a matrix? >
- 4.2class="dot">.n> Q2. What is the "order" of a matrix? dt>
- 4.3class="dot">.n> Q3. How do I represent a matrix using the C/C++ programming languages?
>- 4.4class="dot">.n> Q4. What are the advantages of using matrices? </dt>
- 4.5class="dot">.n> Q5. How do matrices relate to coordinate systems? >
- 5ass="dot">. Arithmetic dt>
- 5.1class="dot">.n> Q6. What is the identity matrix? </a>
- 5.2class="dot">.n> Q7. What is the major diagonal of a matrix? >
- 5.3class="dot">.n> Q8. What is the transpose of a matrix?
- 5.4class="dot">.n> Q9. How do I add two matrices together? >
- 5.5class="dot">.n> Q10. How do I subtract two matrices? dt>
- 5.6class="dot">.n> Q11. How do I multiply two matrices together? t>
- 5.7class="dot">.n> Q12. How do I square or raise a matrix to a power? a>
- 5.8class="dot">.n> Q13. How do I multiply one or more vectors by a matrix? dt>
- 5.6class="dot">.n> Q11. How do I multiply two matrices together? t>
- 6ass="dot">. Determinants and Inverses
- 6.1class="dot">.n> Q14. What is the determinant of a matrix? a>
- 6.2class="dot">.n> Q15. How do I calculate the determinant of a matrix?
- 6.3class="dot">.n> Q16. What are Isotropic and Anisotropic matrices? >
- 6.4class="dot">.n> Q17. What is the inverse of a matrix? dt>
- 6.5class="dot">.n> Q18. How do I calculate the inverse of an arbitary matrix? >
- 6.6class="dot">.n> Q19. How do I calculate the inverse of an identity matrix? >
- 6.7class="dot">.n> Q20. How do I calculate the inverse of a rotation matrix?
- 6.8class="dot">.n> Q21. How do I calculate the inverse of a matrix using Kramer's rule? a>
- 6.9class="dot">.n> Q22. How do I calculate the inverse of a 2x2 matrix?
- 6.10 class="dot">.an>> Q23. How do I calculate the inverse of a 3x3 matrix?
>- 6.11 class="dot">.an>> Q24. How do I calculate the inverse of a 4x4 matrix?
>- 6.12 class="dot">.an>> Q25. How do I calculate the inverse of a matrix using linear equations? t>
- 6.13 class="dot">.an>> Q26. What is a rotation matrix? a>
- 6.14 class="dot">.an>> Q27. How do I generate a rotation matrix in the X-axis? </dt>
- 6.15 class="dot">.an>> Q28. How do I generate a rotation matrix in the Y-axis? </dt>
- 6.16 class="dot">.an>> Q29. How do I generate a rotation matrix in the Z-axis? </dt>
- 6.17 class="dot">.an>> Q30. What are Euler angles? dt>
- 6.18 class="dot">.an>> Q31. What are Yaw, Roll and Pitch?
>- 6.19 class="dot">.an>> Q32. How do I combine rotation matrices? a>
- 6.20 class="dot">.an>> Q33. What is Gimbal lock?
>- 6.21 class="dot">.an>> Q34. What is the correct way to combine rotation matrices? a>
- 6.22 class="dot">.an>> Q35. How do I generate a rotation matrix from Euler angles? </a>
- 6.23 class="dot">.an>> Q36. How do I convert a rotation matrix to Euler angles?
- 6.24 class="dot">.an>> Q37. How do I generate a rotation matrix for a selected axis and angle? t>
- 6.25 class="dot">.an>> Q38. How do I generate a rotation matrix to map one vector onto another? dt>
- 6.26 class="dot">.an>> Q39. What is a translation matrix?
>- 6.27 class="dot">.an>> Q40. What is a scaling matrix? >
- 6.28 class="dot">.an>> Q41. What is a shearing matrix? a>
- 6.29 class="dot">.an>> Q42. How do I perform linear interpolation between two matrices? </dt>
- 6.30 class="dot">.an>> Q43. How do I perform cubic interpolation between four matrices? </dt>
- 6.31 class="dot">.an>> Q44. How can I render a matrix? a>
- 6.32 class="dot">.an>> Q45. What are quaternions? t>
- 6.33 class="dot">.an>> Q46. How do quaternions relate to 3D animation?
- 6.34 class="dot">.an>> Q47. How do I convert a quaternion to a rotation matrix?
- 6.35 class="dot">.an>> Q48. How do I convert a rotation matrix to a quaternion?
- 6.36 class="dot">.an>> Q49. How do I convert a rotation axis and angle to a quaternion? </dt>
- 6.37 class="dot">.an>> Q50. How do I convert a quaternion to a rotation axis and angle? </dt>
- 6.38 class="dot">.an>> Q51. How do I convert spherical rotation angles to a quaternion? </dt>
- 6.39 class="dot">.an>> Q52. How do I convert a quaternion to spherical rotation angles? </dt>
- 6.40 class="dot">.an>> Q53. How do I use quaternions to perform linear interpolation between matrices?
>- 6.41 class="dot">.an>> Q54. How do I use quaternions to perform cubic interpolation between matrices?
1ass='dot'>. The Matrix and Quaternions FAQ ss='perma' href='#s-1'>6;2>="sc-1">
Version 1.2 2nd September 1997 class='line-anchor' id='line-16'>span>
/>
This FAQ is maintained by "hexapod@netcom.com". Any additional suggestions or related questions are welcome. Just send E-mail to the above address.class='line-anchor' id='line-18'>pan>
>
Feel free to distribute or copy this FAQ as you please.ass='line-anchor' id='line-20'>n>
Contributions class='line-anchor' id='line-22'>span>
/>
Introduction I1: steve@mred.bgm.link.com class='line-anchor' id='line-24'>span>
/>
Version 1.2 2nd September 1997 class='line-anchor' id='line-16'>span>
/>
/>
This FAQ is maintained by "hexapod@netcom.com". Any additional suggestions or related questions are welcome. Just send E-mail to the above address.class='line-anchor' id='line-18'>pan>
>
>
Feel free to distribute or copy this FAQ as you please.ass='line-anchor' id='line-20'>n>
Contributions class='line-anchor' id='line-22'>span>
/>
/>
Introduction I1: steve@mred.bgm.link.com class='line-anchor' id='line-24'>span>
/>
/>
2ass='dot'>. Contents of article ='perma' href='#s-2'>¶
I1. Important note relating to ref='/wiki.php/OpenGL' >OpenGL and this documentpan class='line-anchor' id='line-27'><br />
~cpp Questions --------- BASICS ====== Q1. What is a matrix? Q2. What is the order of a matrix? Q3. How do I represent a matrix using the C/C++ programming languages? Q4. What are the advantages of using matrices? Q5. How do matrices relate to coordinate systems? ARITHMETIC ========== Q6. What is the identity matrix? Q7. What is the major diagonal matrix of a matrix? Q8. What is the transpose of a matrix? Q9. How do I add two matrices together? Q10. How do I subtract two matrices? Q11. How do I multiply two matrices together? Q12. How do I square or raise a matrix to a power? Q13. How do I multiply one or more vectors by a matrix? DETERMINANTS AND INVERSES ========================= Q14. What is the determinant of a matrix? Q15. How do I calculate the determinant of a matrix? Q16. What are Isotropic and Anisotropic matrices? Q17. What is the inverse of a matrix? Q18. How do I calculate the inverse of an arbitary matrix? Q19. How do I calculate the inverse of an identity matrix? Q20. How do I calculate the inverse of a rotation matrix? Q21. How do I calculate the inverse of a matrix using Kramer's rule? Q22. How do I calculate the inverse of a 2x2 matrix? Q23. How do I calculate the inverse of a 3x3 matrix? Q24. How do I calculate the inverse of a 4x4 matrix? Q25. How do I calculate the inverse of a matrix using linear equations? TRANSFORMS ========== Q26. What is a rotation matrix? Q27. How do I generate a rotation matrix in the X-axis? Q28. How do I generate a rotation matrix in the Y-axis? Q29. How do I generate a rotation matrix in the Z-axis? Q30. What are Euler angles? Q31. What are yaw, roll and pitch? Q32. How do I combine rotation matrices? Q33. What is Gimbal Lock? Q34. What is the correct way to combine rotation matrices? Q35. How do I generate a rotation matrix from Euler angles? Q36. How do I generate Euler angles from a rotation matrix? Q37. How do I generate a rotation matrix for a selected axis and angle? Q38. How do I generate a rotation matrix to map one vector onto another? Q39. What is a translation matrix? Q40. What is a scaling matrix? Q41. What is a shearing matrix? Q42. How do I perform linear interpolation between two matrices? Q43. How do I perform cubic interpolation between four matrices? Q44. How can I render a matrix? QUATERIONS ========== Q45. What are quaternions? Q46. How do quaternions relate to 3D animation? Q47. How do I convert a quaternion to a rotation matrix? Q48. How do I convert a rotation matrix to a quaternion? Q49. How do I convert a rotation axis and angle to a quaternion? Q50. How do I convert a quaternion to a rotation axis and angle? Q51. How do I convert a spherical rotation angles to a quaternion? Q52. How do I convert a quaternion to a spherical rotation angles? Q53. How do I use quaternions to perform linear interpolation between matrices? Q54. How do I use quaternions to perform cubic interpolation between matrices?
3ass='dot'>. Introduction ss='perma' href='#s-3'>6;2>="sc-3">
3.1class='dot'>.n> span>I1. Important note relating to OpenGl and this document ¶>
~cpp In this document (as in most math textbooks), all matrices are drawn in the standard mathematical manner. Unfortunately graphics libraries like IrisGL, OpenGL and SGI's Performer all represent them with the rows and columns swapped. Hence, in this document you will see (for example) a 4x4 Translation matrix represented as follows: | 1 0 0 X | | | | 0 1 0 Y | M = | | | 0 0 1 Z | | | | 0 0 0 1 | In Performer (for example) this would be populated as follows: M[0][1] = M[0][2] = M[0][3] = M[1][0] = M[1][2] = M[1][3] = M[2][0] = M[2][1] = M[2][3] = 0 ; M[0][0] = M[1][1] = M[2][2] = m[3][3] = 1 ; M[3][0] = X ; M[3][1] = Y ; M[3][2] = Z ; ie, the matrix is stored like this: | M[0][0] M[1][0] M[2][0] M[3][0] | | | | M[0][1] M[1][1] M[2][1] M[3][1] | M = | | | M[0][2] M[1][2] M[2][2] M[3][2] | | | | M[0][3] M[1][3] M[2][3] M[3][3] | OpenGL uses a one-dimensional array to store matrices - but fortunately, the packing order results in the same layout of bytes in memory - so taking the address of a pfMatrix and casting it to a float* will allow you to pass it directly into routines like glLoadMatrixf. In the code snippets scattered throughout this document, a one-dimensional array is used to store a matrix. The ordering of the array elements is transposed with respect to OpenGL. This Document OpenGL | 0 1 2 3 | | 0 4 8 12 | | | | | | 4 5 6 7 | | 1 5 9 13 | M = | | M = | | | 8 9 10 11 | | 2 6 10 14 | | | | | | 12 13 14 15 | | 3 7 11 15 |
''' 4x4 트릭에서 왼쪽 에서터 3x3 행렬은 rotation과 scale 성분 정보 들어가게 구요..
스케일 별루 쓰니.. rotation 이구 보면 되요. 네번째 이 translation 분입다.pan class='line-anchor' id='line-166'>
후후.. 수학 입 구할때 꼭 향 성이 네번때 에 오록 짜시길.pan class='line-anchor' id='line-167'>
3열로 내면.. 흠.. 떻게 될까?? -_-? ㅋ; '''pan class='line-anchor' id='line-168'>
스케일 별루 쓰니.. rotation 이구 보면 되요. 네번째 이 translation 분입다.
후후.. 수학 입 구할때 꼭 향 성이 네번때 에 오록 짜시길.
3열로 내면.. 흠.. 떻게 될까?? -_-? ㅋ; '''