Home

If you're new to Python
and VPython: Introduction

A VPython tutorial

Pictures of 3D objects

What's new in VPython 6

VPython web site
VPython license
Python web site
Math module (sqrt etc.)
Numpy module (arrays)

 
points
points

The points object takes a list of points for pos, like the curve object. The following statement will display two points, each of radius 50 pixels:

points(pos=[(-1,0,0), (1,0,0)], size=50, color=color.red)

The points object is similar to a curve, but with disconnected points. As with curve, the pos attribute is an array of points, and color can also be an array. If you say shape="round", the points are round, which is the default; shape="square" makes square points. The size of the points is specified by size and the default size is 5 (meaning a square 5 by 5, or a circular disk bounded by a 5 by 5 square). The size attribute is in screen pixels if size_units="pixels" (the default), but if size_units="world", the size is in the usual coordinates. The maximum size of a point is about 50 by 50 pixels; specifying a larger size than the maximum does not increase the size.

Lighting does not affect the appearance, which is determined solely by the color. You cannot specify a material for points, and currently it is not possible to specify the opacity of a points object.

See description of Additional Attributes available for all 3D display objects.

Technical caveat: size_units="world" may not work on very old video drivers which do not support OpenGL 1.4 or the ARB_POINT_PARAMETERS extension.  If you have problems, upgrade your video driver.