Jump to content

[SOLVED] how can I get up vector of a node?


photo

Recommended Posts

Posted

in core/scripts/utils.h file, there are two function decomposeTransformDirection and composeTransformDirection,

 

I'm assuming decomposeTransformDirection can be used to get both right/up and direction, but there is no any info about this function, and I simply tested this function, the value returned by p, is not up vector and right vector.

 

then how can I get the Up vector of a node?

Posted

ok, solved, just use this to get up vector

	vec3 up = vec3(0, 0, 1) * rotation(node.getTransform());

×
×
  • Create New...