you need to define an origin, and rotate each point around that origin in xyz space, rotating the points additively in 3 steps. roll, rotations applied on YZ plane, then pitch on those rolled coords applied as a rotation on the XY plane, then yaw applied on those coords as a rotation on the XZ plane. theres no real "right way" but this is how i usually go about it for euler angle style rotation