Vizard 8 » Command Index » Vizard modules » vizmat » <vizmat>.LookToQuat
8.1

<vizmat>.LookToQuat

Converts a look vector to a quaternion rotation

<vizmat>.LookToQuat(  
look # [x,y,z]
)  
look
3 numbers representing a look vector.

Note: This does not represent a point to look at, but a vector pointing in a given direction

Remarks

Given a direction vector, this command will return a quaternion that will look in the same direction.

Return Value

[x,y,z,w]

Example

import vizmat

#This will print out:
# [0,0,0,1]
print(vizmat.LookToQuat(0,0,1))