public void fromAngles(float xAngle, float yAngle, float zAngle) {
        float angle;
        float sr, sp, sy, cr, cp, cy;
        angle = zAngle * 0.5f;
        sy = (float)Math.sin(angle);
        cy = (float)Math.cos(angle);
        angle = yAngle * 0.5f;
        sp = (float)Math.sin(angle);
        cp = (float)Math.cos(angle);
        angle = xAngle * 0.5f;
        sr = (float)Math.sin(angle);
        cr = (float)Math.cos(angle);

        float crcp = cr * cp;
        float srsp = sr * sp;

        x = (sr * cp * cy - cr * sp * sy);
        y = (cr * sp * cy + sr * cp * sy);
        z = (crcp * sy - srsp * cy);
        w = (crcp * cy + srsp * sy);
    }