Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Coder's Corner » Calculating position of background screen » 2008-12-05 04:40:13

neigaard
Replies: 1

Hi

Im a dumb math to math, and I need some help with a small computer game. I hope this is the right forum, if not could you maybe point me to the right one.


I have two screens, a background screen and the screen that is actually showing. The background screen is bigger than the screen showing, and the background screen moves and rotates while the screen showing stays still. See the background screen as a landscape where the showing screen can navigate around in. If the showing screen moves outside the background screen, the background screen (which is really the one that is moving) move so that what is visible of the background screen is like the landscape just continues. Its a bit hard to explain, so I added 3 drawings, where you should imagine that each square on the big background screen contains exactly the same background image, and thus if the showing screen is outside the background screen (picture math_02), the background screen must be moved so that what you see on the showing screen is correct. Does this make sense?

What I just cant figure out dunno, is a formula (or more formulas maybe) that can calculate the exact position of the background screen in these cases. Can you help a math fool here?

I have the coordinates of the center of the background screen, the size of the background screen, the rotation angle of the background screen, the size of the shown screen, is any more needed?

Best regards and high hopes
Søren

Board footer

Powered by FluxBB