limitations of vpython - things I wish I could do

40 views
Skip to first unread message

Erik the Anarchitect

unread,
Jul 11, 2016, 5:50:46 PM7/11/16
to VPython-users
Happily learning vpython. However I see two things that I wish I had but can't find.

There seems to be no support for points at infinity, horizons, etc. I might want to have the sky and a horizon in some of my images.

Also, is there a way to declare a 3D object without rendering it immediately?
If I say something like, for instance, A=sphere() it immediately draws the sphere.

But what if I want to declare A to be a sphere but not render it just yet, if at all?

(For instance, if I want to use it as part of a sequence that derives the shape of another object?)

Bruce Sherwood

unread,
Jul 11, 2016, 6:36:09 PM7/11/16
to VPython-users
You are correct that there isn't support for points at infinity etc.

Create your sphere as A = sphere(visible=False).

Also notice that until you reach something like rate(100) or scene.waitfor('click') or the end of your program, no rendering is done, so if you say A = sphere() and then do a whole lot of other calculations and object creations you won't see anything until a wait state, so if you execute A.visible = False as the last thing before the wait state you'll never see the sphere.

Bruce Sherwood

unread,
Jul 11, 2016, 6:41:42 PM7/11/16
to VPython-users
I guess I should mention for completeness that when you're inside an object you do see the inside of the object, so in either Jupyter VPython orGlowScript VPython you might try this:

scene.range = 2
box()
sphere(radius=4, texture=textures.earth, shininess=0)

You can rotate the camera and see the inside of the Earth as background.
Reply all
Reply to author
Forward
0 new messages