MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / adjustPoint

Function adjustPoint

src/gamesbyexample/rotatingcube.py:137–142  ·  view source on GitHub ↗

Adjusts the 3D XYZ point to a 2D XY point fit for displaying on the screen. This resizes this 2D point by a scale of SCALEX and SCALEY, then moves the point by TRANSLATEX and TRANSLATEY.

(point)

Source from the content-addressed store, hash-verified

135
136
137def adjustPoint(point):
138 """Adjusts the 3D XYZ point to a 2D XY point fit for displaying on
139 the screen. This resizes this 2D point by a scale of SCALEX and
140 SCALEY, then moves the point by TRANSLATEX and TRANSLATEY."""
141 return (int(point[X] * SCALEX + TRANSLATEX),
142 int(point[Y] * SCALEY + TRANSLATEY))
143
144
145"""CUBE_CORNERS stores the XYZ coordinates of the corners of a cube.

Callers 1

rotatingcube.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected