We must view a wedge-dash formula from the correct angle to convert it to a Fischer projection.
Here's the wedge-dash structure.
We now view the molecule with #"C-1"# at the top and with all chiral carbons closest to our eye.
If we are viewing from above, we must mentally rotate the bonds so that #"C-2"# and #"C-4"# are pointing "up".
When we do this, the wedges become dashes, and the dashes become wedges, as in the picture below.
So the #"OH"# groups on #"C-2"# and #"C-4"# become wedges.
We don't rotate #"C-3"# and #"C-5"#, so the bonds to the #"OH"# groups on those atoms remain the same.
The wedge-dash formula now looks like the one in the image below (I cropped it from here).
The wedges are now on the right, and the dashes are on the left.
It is as if we had wrapped the chain around a cylindrical tube.
When you flatten the structure onto the surface of the cylinder, you get the Fischer projection of D-glucose.