Showing posts with label coordinates. Show all posts
Showing posts with label coordinates. Show all posts

Friday, May 8, 2015

Coordinate system for 2D computer graphics


Computers have a peculiar way to orient the axis of their coordinate system. It looks like this:



Basics

This means that the Upper-Left corner of an image or a window is (0,0).  In this type of programming, the unit along the axes is the pixel. When you create images, try using common image formats such as 800X480, or go for a square image of size 600X600.

With the graphics.py library, you can create a 800 pixels wide by 480 pixels high image using:

 mywindow = GraphWin( "Window Name", 800, 600 )