Hi, I'm making a 2D simulation of the solar system, it works PERFECTLY, but I want to be able to zoom in and out of it, (Make the lines smaller), but i can't figure out how to get it to work right.
I attached a picture to show you what's happening, I want the lines to get smaller when i zoom out and bigger when i zoom in
I'm not completely sure about how your coordinates are set up, but you should scale the difference vectors from the Sun to the planets. Let P be the position of the planet, S the position of the Sun and z the zoom factor. Then, the final position of the planet at some zoom factor should be something like S + z(P - S).
OK your algorithm works, but it makes everything draw farther than it's supposed to, maybe it's just where i'm implementing it, i'll keep moving stuff around and figure it out. Thanks for the help!