In general, I'd ride slightly behind the right rear corner of the bus or truck.
However, if it is a bus and there is a bus stop at the beginning of the next block, there is a good chance the bus will pull to the right to get to the bus stop, leaving you stopped and trapped behind it. In that case I ride behind the center of the bus so that I can move left and pass the bus as it slows and moves right.
Don't ride to the right of the central part of the bus or truck, you are at risk of being invisible to the driver and getting right hooked or squeezed.