DOTY

4. DirectXMath - Transform 본문

DirectX

4. DirectXMath - Transform

증식세포 2023. 5. 2. 16:07
728x90
반응형
  • DirectXMath의 변환 함수로 앞의 Vector과 Matrix를 사용한다.\
// 비례행렬 만들기
// 1. 계수 사용
XMMATIX XM_CALLCONV XMMatrixScaling(
	float ScaleX,
    	float ScaleY,
    	float ScaleZ);
    
// 2. 벡터 사용
XMMATRIX XM_CALLCONV XMMatrixScaling(
	FXMVECTROR Scale);
    
// 회전행렬 만들기 (Angle은 시계방향 각도)
// 1. X축 회전
XMMATRIX XM_CALLCONV XMMatrixRotationX(
	float Angle);
    
// 2. Y축 회전
XMMATRIX XM_CALLCONV XMMatrixRotationY(
	float Angle);
    
// 3. Z축 회전
XMMATRIX XM_CALLCONV XMMatrixRotationZ(
	float Angle);
    
// 4. 임의의 벡터 축에 대한 회전
XMMATRIX XM_CALLCONV XMMatrixRotationAxis(
	FXMVECTOR Axis,
    	float Angle);
    
// 이동행렬 만들기
// 1. 계수 사용
XMMATRIX XM_CALLCONV XMMatrixTranslation(
	float OffsetX,
    	float OffsetY,
    	float OffsetZ);
    
// 2. 벡터 사용
XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(
	FXMVECTOR Offset);
    
// 벡터 × 행렬
// 점 변환인 경우에는 Vector V의 네번 째 값을 1로 설정한다.
// 벡터 변환인 경우에는 Vector V의 네번 째 값을 0으로 설정한다.
XMVECTOR XM_CALLCONV XMVector3TransformCoord(
	FXMVECTOR V,
    	CXMMATRIX M);
728x90
반응형

'DirectX' 카테고리의 다른 글

DirectX11. 2) D3D11 Initialize  (1) 2023.06.09
DirectX11. 1) 창 띄우기  (0) 2023.06.07
3. DirectXMath - Matrix  (0) 2023.04.24
2. DirectXMath - Vector  (0) 2023.04.21
1. DirectX12 - Win32 프로젝트 ( &에 l-value가 있어야 합니다 )  (0) 2023.04.17
Comments