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 · 3 comments
Open

3d rendering Issue: #182

ramayanbindas opened this issue Feb 21, 2024 · 3 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/Assigment_semister_1 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.

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

2 participants