Mod Tool/Scripting: Difference between revisions

m
+cat
mNo edit summary
m (+cat)
Line 1: Line 1:
===Math===
 
====Euler rotation -> matrix====  
 
 
 
 
===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====
====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====
====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====
====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]]