2
\$\begingroup\$

I am noob to game development, and while using a simple graphics library in Python to make a 2D game, I noticed that the coordinate system of the library had its upper left corner as (0,0), whereas conventionally (at least in math) the lower left corner is set as (0,0).

I want to keep the world space in my physics calculations, but want to map the world space coordinates into the screen space. Furthermore, I want the world space sizes to be a scale of 10 larger than the screen space sizes.

In terms of programming methodology, how should I go about doing this in the most modular fashion?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Conventionally this is done with a view-projection matrix to map world coordinates to screenspace. Are existing questions about view-projection matrices not providing what you need for your case? \$\endgroup\$ – DMGregory Nov 3 '17 at 2:45
1
\$\begingroup\$

Would something like

http://www.pentadact.com/2015-01-27-help-me-with-a-trigonometry-problem-for-heat-signature/

Help? He has the solution he found a bit further down in the post.

I'll assume you don't need rotation, because you don't directly mention it in your post.

Actually, assuming that, it just looks like you need to define a world 10 times larger than your screen, and then transform the screen across it. Any objects on screen are at the screen coordinates of

(actualX-screenXTransform,actualY-screenYTransform)

Unless I'm grossly misunderstanding something, that should be it.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This is a link only answer. Although it can help the OP fix their problem, if the link gets taken down, your answer will be completely useless for future users. Can you edit your answer and provide the actual information for the question to be answered? Not that you can leave the link there, just that it should not be the focus of the answer. \$\endgroup\$ – Vaillancourt Nov 3 '17 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.