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

3d rendering Issue: #182

Open
ramayanbindas opened this issue Feb 21, 2024 · 8 comments
Open

3d rendering Issue: #182

ramayanbindas opened this issue Feb 21, 2024 · 8 comments

Comments

@ramayanbindas
Copy link

Intent: We are trying only to display 3d objects with their default parameters
Output: But it only showing a black screen after execution.

System: Linux operating system: Fedora Linux 39 (Workstation Edition), browser: Firefox version 120

from vpython import *
from sys import exit

def menu():
    print('1. Curve')
    print('2. Sphere')
    print('3. Cone')
    print('4. Arrow')
    print('5. Rings')
    print('6. Cylinder')

ch = "y"
while ch != "n":
    scene = canvas()
    menu()

    choice = int(input('Enter choice: '))
    if choice == 1:
        curve()
    elif choice == 2:
        sphere()
    elif choice == 3:
        cone()
    elif choice == 4:
        arrow()
    elif choice == 5:
        ring()
    elif choice == 6:
        cylinder()
    else:
        print('Invalid choice')

    ch = input('Do you want to continue (y/n)? ').lower()
    scene.delete()

exit()

Tried to resolve this issue: By passing some parameters, by redrawing the screen, updating the screen etc.

ramayanbindas added a commit to ramayanbindas/BRC-Assigment that referenced this issue Feb 21, 2024
Code is correct, but rendering issue by the library. This is the fault of the 'vpython' library. So till then think before writing the code. Expected outputs are 3d objects but given outputs are black screen. Issue is posted in their git repo, link: vpython/glowscript#182
@BruceSherwood
Copy link
Member

What Python are you using? From the installation instructions at vpython.org: The vpython module currently works with Python versions 3.8, 3.9, and 3.10. (We are working on a release for 3.11)

@ramayanbindas
Copy link
Author

ramayanbindas commented Feb 27, 2024 via email

@BruceSherwood
Copy link
Member

Try running this Web VPython program: tinyurl.com/vporbit. If it fails, it could be that WebGL2 is not available in your browser. Go to https://get.webgl.org/
You should see a rotating wire frame box.
Next, go to https://browserleaks.com/webgl
and report whether both WebGL and WebGL2 are checked True.

@nd-thang
Copy link

I also have the same problem, I have some smartphone devices, on the device with WebGL_Unmasked_Renderer value as Mali-..., it does not display block, spheres, text,... but only displays the trajectory (see attached video https://files.catbox.moe/qyluvx.mp4), it works normally on the devices with WebGL_Unmasked_Renderer: ANGLE

@nd-thang
Copy link

nd-thang commented Oct 1, 2024

@BruceSherwood could you help to check my above comment?

@BruceSherwood
Copy link
Member

I know nothing about the issues you mention. I'll mention that you might run https://get.webgl.org/webgl2/ to see whether your device does or doesn't support WebGL2 in the browser; VPython uses WebGL2.

@nd-thang
Copy link

nd-thang commented Oct 2, 2024

@BruceSherwood My phone has WebGL2 supported, there is some kind of graphics type can not be rendered like text, box, sphere,... Its happens on both Chrome, Firefox. I have some other devices which also happens are has WebGL_Unmasked_Renderer: Mali-xyz

Screenshot_20241002_074801_Chrome
Screenshot_20241002_074819_Chrome

AtomicSolid-VPython
Screenshot_20241002_074907_Chrome
Bounce-VPython
Screenshot_20241002_075002_Chrome
BillboardingText
Screenshot_20241002_075029_Chrome

@BruceSherwood
Copy link
Member

Sorry, but I am unable to debug the problems you have encountered. I've never heard of anyone else seeing the problems you see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants