![]() |
Python_2
1.0
|
Public Member Functions | |
def | __init__ (self, world, viewport, ydown=True) |
Constructor. More... | |
def | windowVecToViewport (self, x, y) |
Maps a single vector from world coordinates to viewport (screen) coordinates. More... | |
def | viewportToWindow (self, x, y) |
Maps a single point from screen coordinates to window (world) coordinates. More... | |
def | windowToViewport (self, *p) |
Maps points from world coordinates to viewport (screen) coordinates. More... | |
Public Attributes | |
ys | |
world | |
Three vertices of a triangle in world coordinates. More... | |
viewport | |
Three vertices of a triangle in GPS coordinates. More... | |
T | |
Hold the world to GPS transformation matrix. More... | |
I | |
Inverse matrix of T. More... | |
Private Member Functions | |
def | __windowToViewport (self, x, y) |
Maps a single point from world coordinates to viewport (screen) coordinates. More... | |
def mapper2.mapper2.__init__ | ( | self, | |
world, | |||
viewport, | |||
ydown = True |
|||
) |
Constructor.
A linear transformation is uniquely defined by how its base vectors are transformed.
In 2D, three non-colinear points in a coordinate system A, define a base with two vectors.
Therefore, if we know the image of these three points onto another coordinate system B, the transformation that takes A -> B is defined.
world | window triangle. |
viewport | screen triangle. |
ydown | whether Yaxis is upside down. |
|
private |
Maps a single point from world coordinates to viewport (screen) coordinates.
x,y | given point. |
References _08c_clock.clock.T, mapper2.mapper2.T, mapper.mapper.ys, and mapper2.mapper2.ys.
Referenced by mapper2.mapper2.windowToViewport().
def mapper2.mapper2.viewportToWindow | ( | self, | |
x, | |||
y | |||
) |
Maps a single point from screen coordinates to window (world) coordinates.
x,y | given point. |
References mapper2.mapper2.I.
def mapper2.mapper2.windowToViewport | ( | self, | |
* | p | ||
) |
Maps points from world coordinates to viewport (screen) coordinates.
p | a variable number of points. |
References mapper.mapper.__windowToViewport(), and mapper2.mapper2.__windowToViewport().
def mapper2.mapper2.windowVecToViewport | ( | self, | |
x, | |||
y | |||
) |
Maps a single vector from world coordinates to viewport (screen) coordinates.
x,y | given vector. |
References _08c_clock.clock.T, mapper2.mapper2.T, mapper.mapper.ys, and mapper2.mapper2.ys.
mapper2.mapper2.I |
Inverse matrix of T.
Referenced by mapper2.mapper2.viewportToWindow().
mapper2.mapper2.T |
Hold the world to GPS transformation matrix.
Referenced by mapper2.mapper2.__windowToViewport(), and mapper2.mapper2.windowVecToViewport().
mapper2.mapper2.viewport |
Three vertices of a triangle in GPS coordinates.
mapper2.mapper2.world |
Three vertices of a triangle in world coordinates.
mapper2.mapper2.ys |
Referenced by mapper2.mapper2.__windowToViewport(), and mapper2.mapper2.windowVecToViewport().