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

isotropic Display for 1920x1200 monitors #224

Closed
mrmsbarnes opened this issue May 15, 2018 · 4 comments
Closed

isotropic Display for 1920x1200 monitors #224

mrmsbarnes opened this issue May 15, 2018 · 4 comments

Comments

@mrmsbarnes
Copy link

@mrmsbarnes mrmsbarnes commented May 15, 2018

Something believes my 1920 x 1200 monitor has only 1080 units of height. Spheres are stretched to eggs. I'd like to see correct display of 3D objects.

@paddywwoof
Copy link
Collaborator

@paddywwoof paddywwoof commented May 16, 2018

What system are you running on? On the rpi the screen dimensions come from bcm.graphics_get_display_size() on x11 they come from xlib.XWidthOfScreen() and xlib.XHeightOfScreen() and using pygame (on windows or x11 but not rpi) they come from pygame.display.Info()

Does it work OK with different monitors? Do other applications get the correct size?

@mrmsbarnes
Copy link
Author

@mrmsbarnes mrmsbarnes commented May 16, 2018

Yes, we are only talking RPi (thank you, though, for investing so much work for multi-platform). When I use a 1920x1080 monitor there is no problem (ViewSonic TD2220). I see anisotropic stretching on my 1920x1200 monitor (Asus VS24A). I think you are suggesting there is a disagreement between bcm and x11 for this case. Do you have means to test on a 1920x1200 monitor?

@mrmsbarnes
Copy link
Author

@mrmsbarnes mrmsbarnes commented May 16, 2018

Sorry, maybe there is a disagreement between bcm and pygame. Is x11 even used on RPi?

@paddywwoof
Copy link
Collaborator

@paddywwoof paddywwoof commented May 16, 2018

I've not managed to get pi3d to work with x11 or pygame on the RPi (but haven't tried too hard either). I've seen a couple of comments on forums about getting the pi or monitor to set themselves up correctly, various suggestions for using different HDMI numbers.

To check what the broadcom driver thinks the monitor is you can type this in a python terminal

$ python3
>>> import pi3d
>>> from pi3d.constants import bcm
>>> import ctypes
>>> bcm.bcm_host_init()
>>> w = ctypes.c_int()
>>> h = ctypes.c_int()
>>> bcm.graphics_get_display_size(0, ctypes.byref(w), ctypes.byref(h))
>>> print(w, h)

If you can't get the monitor detection to work properly you can quite easily modify the value used in pi3d by changing it just after the Display object has been created:

display = pi3d.Display.create()
display.width = 1920
display.height = 1200

Ideally you would change the fourth value in the lens array that you can optionally pass to the Camera which defines the aspect ratio, however the orthographic camera doesn't have a lens and uses display.width and display.height directly.

Hope this solves your problem

@paddywwoof paddywwoof closed this May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.