Say you have a level plane (like the slab, hopefully), and you mark on it your shower drain location (like you did on the tape) and the projection straight upwards of the p-trap inlet. You'd like them to coincide, then you could just use a vertical pipe to connect them.
But if you can't get them to coincide, you get them as close as you can. Say the horizontal distance between them (the two projections onto that level plane) ends up 5" (to make up a number), and say the p-trap inlet is 12" below the slab (the depth needs to be a fixed amount greater than the horizontal offset, 7" should definitely be enough extra) . Then you can use (2) 45s like this:
Below the drain is a short vertical section of pipe. Then a 45 goes on the bottom, and the outlet is no longer vertical. [Or if you are really height challenged, you could use a street 45 directly into the shower drain, if it's a solvent weld connection.] You spin the 45 so it points at the p-trap inlet. Now you need a short section of pipe (the length should be (1.414 * 5") - 3", and that formula will work as long as the result is at least 1.5" (the pipe taken up by the two hubs on the 45s), and you can change 5" to your actual measurement). Then you put the other 45 on the slanted pipe so that its outlet points down; it will be directly over the trap inlet. [And again if you are really height challenged, you could use a street 45 into the p-trap inlet.]
Cheers, Wayne