I generally use John Myung's "Reverse Mode Approach". It kind of goes like this (I'm working from the perspective of 6 string bass here):
Starting on the first fret of the B string to the E string. First 6 notes of C Ionian (C, D, E, F, G, A) shift to the 7th fret of the E String. On the E and A strings play the first 6 notes of B Locrian (B, C, D, E, F, G, A) shift to the 12th fret of the A String. Play the first 6 notes of A Aeolian on the A and D Strings (A, B, C, D, E, F). Shift to the 17th fret and play the first 6 notes of G Mixolydian on the D and G strings (G, A, B, C, D, E). Shift up to the 20th fret and play the first 5 notes of F Lydian on the G and C strings (F, G, A, B, C). Then Reverse the whole process back down.
I know I went above and beyond 3 octaves but like I said I'm working with a 24 fret 6 string bass and you can modify this approach for whatever bass you are playing.
Also you can check out the entire video of John Myungs Progressive Bass Concepts on YouTube since it is not available on DVD I highly recommend it.
Stay Brown,
Rev J