What is the Shift Register?
Even before trying to use 74HC595 to multiplex leds, you have to understand what the Shift Register is and how it works.
And it’s simple: a Shift Register component simply extends the number of digital outputs of a microcontroller such as a RaspberryPi or Arduino.
Thus a component such as the 74HC595 will allow to control 8 digital outputs with in addition the possibility of linking several components 74HC595 to each other.
For my cube led 3d of 8x8x8, I will be able to link 8 components 74HC595 between them in order to have 64 digital outputs.
How does the Shift Register work?
To understand the operation of a Shift Register (and in particular the 74HC595), the easiest way is to imagine that you have a line of 8 chairs.
These 8 chairs are either empty (value 0) or occupied (value 1).
Now consider that every 5 seconds a buzzer sounds and the people seated must move from a chair on their right.
If the rightmost chair was occupied, then the person is considered to be leaving. For the leftmost chair, it can either remain empty or someone comes to take it.