With regard to your question, there are 2 specific parts I see.
1) Standing up quick.
When you stand up very quickly, then the inertia in your body causes the blood to run out of your head and neck and upper body. Thus you see stars and some people may faint.
This happens to me too but I also get a headache sometimes!
[2.1] I think this is something different, when you stretch your entire body, you strecth the veins and arteries a bit as well, and in doing that you increase the distance that blood has to travel around the body which means that again your brain gets less blood and you see stars and feel feint.
OR [option 2.2] - I like this one better
When you stretch you entire body, you are squeezing many muscles at the same time, and they all require oxygen, this sudden requirement of oxygen by all the muscles being stretched causes less oxygen to be available in the blood for the brain and hence you see stars...
Thats my 2 cents worth :)