Using your own texture in Jupyter VPython

26 views
Skip to first unread message

Bruce Sherwood

unread,
Jan 26, 2017, 9:45:46 AM1/26/17
to VPython-users
The documentation for textures in Jupyter VPython and GlowScript VPython explains how to reference a texture that is available on a web site. Missing from that documentation is how to reference a texture on your own computer when using Jupyter VPython.

Look at the Python directory Lib/site-packages/vpython/vpython_data. There you will find the standard textures that are installed with VPython.

Place a copy of your texture in this folder. Suppose its file name is T.jpg.

In your VPython program, the following statement will display a box with your texture on it:

box(texture='/nbextensions/vpython_data/T.jpg')
Reply all
Reply to author
Forward
0 new messages