19,584
edits
Paradox-01 (talk | contribs) mNo edit summary |
m (+cat) |
||
Line 1: | Line 1: | ||
===Math=== | |||
====Euler rotation -> matrix==== | |||
=== | |||
==== | |||
function cosn (n) | function cosn (n) | ||
cosn = cos(XSIMath.DegreesToRadians(n)) | cosn = cos(XSIMath.DegreesToRadians(n)) | ||
Line 53: | Line 47: | ||
==== | ====Matrix -> Euler rotation==== | ||
Function Atan2(y, x) | Function Atan2(y, x) | ||
If x > 0 Then | If x > 0 Then | ||
Line 129: | Line 123: | ||
==== | ====Euler rotation -> quaternion==== | ||
dim x, y, z, dRotation, qRotation | dim x, y, z, dRotation, qRotation | ||
x = 90 | x = 90 | ||
Line 155: | Line 149: | ||
==== | ====Quaternion -> Euler rotation==== | ||
dim qW, qX, qY, qZ, qRotation, x, y, z | dim qW, qX, qY, qZ, qRotation, x, y, z | ||
Line 179: | Line 173: | ||
'qW = ... * -1 | 'qW = ... * -1 | ||
'set qRotation = XSIMath.CreateQuaternion (qW, qX, qY, qZ) | 'set qRotation = XSIMath.CreateQuaternion (qW, qX, qY, qZ) | ||
[[Category:Windows-only modding tools]] |