-
Notifications
You must be signed in to change notification settings - Fork 335
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
Camera2D unexpected results in simple case #2558
Comments
I see now, the issue is that
arcade/arcade/camera/camera_2d.py Lines 138 to 139 in f4f4521
I had expected that when I pass If I change to this everything works as expected:
Does it make sense to init Maybe at least the docstring could be clarified what "XY plane" means? arcade/arcade/camera/camera_2d.py Lines 61 to 62 in f4f4521
Either way, I'm happy that I have a working solution with a camera. :-) |
One more issue I ran into is that Is this something that should be improved that to compute how many points to use for the screen render first the transform to screen pixel coordinates is applied? As workaround I now use ![]() |
Okay, Github initially hid the extra messages, so my first response wasn't helpful. The reason it sits in the center of the viewport is to mimic Arcade's default behavior of having (0.0, 0.0) in the bottom left corner. Maybe this should be changed if you set the projection. However, the center of the projection doesn't really make sense either. The documentation for cameras is very lacking at the moment as I depriortised it to get 3.0 out. It's on my todo list. |
I'm trying to use
Camera2D
for the first time (x-ref #2557) and wanted to have a solar system with sun at world position (0, 0) and earth at world position (1, 0) etc, but then have it displayed on a larger window e.g. with 800 x 600 pixels.I tried to create a
Camera2D
for this that does this world to screen pixel mapping like this:My understanding from the docs is that
camera.projection
should be theRect
in world coordinates andcamera.viewport
theRect
in screen pixel coordinates. So far it looks good to me, what I expected.However then when I try to use this to draw it doesn't do what I expected, to put the sun from world position (0, 0) to the screen center at pixel position (400, 300).
I see this is what
project
andunproject
gives:This is not what I expected.
Is this a bug?
Or probably I'm simply not grokking yet how cameras work?
The text was updated successfully, but these errors were encountered: