Custom Background Image

435 views
Skip to first unread message

Virendra Kate

unread,
Apr 25, 2017, 7:25:05 PM4/25/17
to VPython-users
Hello,

Is there a way to import an image and use it as the scene background? Simply using a fixed texture using materials.texture() is not an option in my case. 

If not then is there a way to change the opacity of the scene color and make it transparent (except the objects created inside the scene) ?

Thank you.

Bruce Sherwood

unread,
Apr 25, 2017, 9:30:09 PM4/25/17
to VPython-users
For importing an image to use as a texture in Classic VPython, see this Help article:


There isn't a way to replace the background with this image, but you could place large thin boxes around your scene.

I don't understand what is meant by "scene color" and its opacity. Do you mean scene.background? You can make it any color you wish, but it doesn't have an opacity attribute.

Virendra Kate

unread,
Apr 26, 2017, 4:47:19 PM4/26/17
to VPython-users

Thanks for the quick reply Bruce. 

For others who might need to use an image as a background, I referred to the link which Bruce has mentioned above and https://github.com/vpython/visual/blob/master/examples/stonehenge.py and was able to import an image and use it as the texture on a thin slab ( makeshift background ).

Regards,
Virendra
Reply all
Reply to author
Forward
0 new messages