홈
태그
미디어로그
위치로그
방명록
Angler Blog
(115)
일상생활_리뷰
(1)
UnrealEngine
(3)
ROS
(3)
Network
(5)
GamePrograming
(35)
Create Game
(9)
Direct3D
(14)
OpenGL
(4)
Orge Engine
(4)
내가본 GPG_One
(4)
랭귀지
(20)
C\C++
(5)
API
(4)
MFC
(7)
OpenMP
(4)
KAU
(38)
운영체제
(4)
Linux
(34)
iOS
(1)
언어정리
(4)
휴양
(0)
ABOUT ME
-
트위터
인스타그램
Today
-
Yesterday
-
Total
-
Angler
Angler
메뉴
검색
컨텐츠 검색
사원수를 이용한 로테이션
GamePrograming/Direct3D
2009. 6. 25. 12:26
a.end = D3DXVECTOR3(0.0f, 0.0f, 400.0f); D3DXVECTOR3 dot3(1.0f, 0.0f, 0.0f); D3DXVECTOR3 vAxis(0,1,0); float fAngle = acos(D3DXVec3Dot(&a.end, &dot3) / (D3DXVec3Length(&a.end)* D3DXVec3Length(&dot3))); D3DXQUATERNION q; D3DXQuaternionRotationAxis(&q, &vAxis,fAngle); inverseRotate(q,a.end); void inverseRotate(D3DXQUATERNION& q, D3DXVECTOR3 & v) { D3DXQUATERNION myInverse; myInverse.x = -q.x;//*msq; myInverse.y = -q.y;//*msq; myInverse.z = -q.z;//*msq; myInverse.w = q.w;//*msq; //v = (myInverse * v) ^ (*this); D3DXQUATERNION left; left.w = - myInverse.x*v.x - myInverse.y*v.y - myInverse.z *v.z; left.x = myInverse.w*v.x + myInverse.y*v.z - v.y *myInverse.z; left.y = myInverse.w*v.y + myInverse.z*v.x - v.z*myInverse.x; left.z = myInverse.w*v.z + myInverse.x*v.y - v.x *myInverse.y; v.x =left.w*q.x + q.w*left.x + left.y*q.z - q.y*left.z; v.y =left.w*q.y + q.w*left.y + left.z*q.x - q.z*left.x; v.z =left.w*q.z + q.w*left.z + left.x*q.y - q.x*left.y; } 사원수 로테이션
공유하기
게시글 관리
Angler
관련글
관련글 더보기
픽킹(picking) - 1
MFC Direct X 연동
블렌딩
ASE Animation [ *TM_ANIMATION FINAL ]
댓글
댓글 접기
댓글 펼치기
티스토리툴바