This page will guide you along the first steps with Elements, you are heartly invited to
visit our IRC channel #elements on irc.freenode.net. No matter which timezone, there are
always friendly people around which are happy to
help out and discuss issues and ideas :-)
Let's begin with an overview of the important
concepts.
Drawing Methods
Elements can draw with different methods:
cairo
pygame
opengl_pyglet
(more coming soon :)
Be default, it is set to pygame, and can be changed on initializing Elements:
Elements will translate all input parameters to it's internal coordinate system (also called world coordinate system).
The input coordinate system (screen coordinate system) is by default set to pygames,
which means that adding an object at (0,0)
will let it appear in the upper left corner. You can change the origin of your system with:
Elements supports both, pixels and meters as input for lengths and positions. By default, the input units
are recognized as pixels, and will be translated into meters by the given ppm value (see
elements.__init__).
If you want to change the default input system (so you can supply the elements api
with parametersin meters rather than pixels), you can do so with
Init: p = m / V ([p] = kg / m³)
Air 0.001225
Liquid ammonia 0.682
Oil 0.8
Water 1.0
Glycerine 1.26
Concrete 2.4
Aluminium 2.7
Iron 7.87
Copper 8.92
Lead 11.35
Mercury 13.6
Gold 19.3
Platinum 21.4
Osmium 22