Rotate Point Around Vector

void RotatePointAroundVector(x#,y#,z#,u#,v#,w#,a#)
{ ux#=u*x
  uy#=u*y
  uz#=u*z
  vx#=v*x
  vy#=v*y
  vz#=v*z
  wx#=w*x 
  wy#=w*y
  wz#=w*z
  sa#=Sin(a)
  ca#=Cos(a)
  x#=u*(ux+vy+wz)+(x*(v*v+w*w)-u*(vy+wz))*ca+(-wy+vz)*sa
  y#=v*(ux+vy+wz)+(y*(u*u+w*w)-v*(ux+wz))*ca+(wx-uz)*sa
  z#=w*(ux+vy+wz)+(z*(u*u+v*v)-w*(ux+vy))*ca+(-vx+uy)*sa
} 

http://www.blitzbasic.com/Community/posts.php?topic=57616

Comments

Popular posts from this blog

Drawing textured cube with Vulkan on Android

glTF loader for Android Vulkan

C++ unit testing & CI integration in GitHub (I/2)