So I'm trying to get the vector given the yaw, pitch, and roll using this formula
var x = (-Math.cos(yaw) * Math.sin(pitch) * Math.sin(roll)) - (Math.sin(yaw) * Math.cos(roll));
var y = (-Math.sin(yaw) * Math.sin(pitch) * Math.sin(roll)) + (Math.cos(yaw) * Math.cos(roll));
var z = (Math.cos(pitch) * Math.sin(roll));
I tried to plot it in a 3d space and the left and right direction seems correct but the direction up and down is different. The direction up is current at position (0,-1,0) as (X,Y,Z).
How do I rotate it so that the direction up is at (0,0,-1) as (X,Y,Z)?