|
From: Bruce S. <Bru...@nc...> - 2008-12-30 21:19:39
|
This code fragment displays a blue sphere named ball, then enters an
infinite loop looking for mouse events. If you click on the ball, the
ball is "picked" and its color is changed to red:
from visual import *
ball=sphere(color=color.blue)
while True:
if scene.mouse.events:
m = scene.mouse.getevent()
if m.pick is ball:
ball.color = color.red
Mr Gerard Kelly wrote:
> Hi, I'm new to using Python and I haven't looked at VPython yet, but I
> was just wondering about what it can do. Is it possible to create an
> event-driven 3D model, as in it responds to pointing and clicking on the
> actual graph itself (for instance, clicking on a ball makes it change
> color, or move, or something like that)?
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Visualpython-users mailing list
> Vis...@li...
> https://lists.sourceforge.net/lists/listinfo/visualpython-users
>
|