Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create vector3_for_2d_rendering.py #2496

Merged
merged 21 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update graphics/vector3_for_2d_rendering.py
Co-authored-by: Dhruv <dhruvmanila@gmail.com>
  • Loading branch information
amaank404 and dhruvmanila authored Sep 28, 2020
commit 9975733217149c757fbfddce61ff2fad05265886
2 changes: 1 addition & 1 deletion graphics/vector3_for_2d_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def convert_to_2d(x: float, y: float, z: float, scale: float,
(7.6923076923076925, 15.384615384615385)
"""
amaank404 marked this conversation as resolved.
Show resolved Hide resolved
if not all(isinstance(val, (float, int)) for val in locals().values()):
raise ValueError("Input values must either be float or int: "
raise TypeError("Input values must either be float or int: "
amaank404 marked this conversation as resolved.
Show resolved Hide resolved
f"{list(locals().values())}")
projected_x = ((x * distance) / (z + distance)) * scale
projected_y = ((y * distance) / (z + distance)) * scale
Expand Down