From: Roberto A. M. <rha...@ho...> - 2008-12-12 14:23:10
|
> After some discussion with David Scherer, we're convinced that > scene.objects should indeed remain a tuple in Visual 5.0, not a list. As > he says, "Lists are mutable, so the user can try to do things like del > scene.objects[2] and won't get any error message or indication that they > are not doing the right thing. IMO error checking is MORE important than > backward compatibility: hardly anyone will remember Visual 3 in a year, > but people will make the same errors forever." I agree with most of the previous paragraph. > But I also have a question about the example code you show. > > m.pick is the object picked, so you already know the object. What value > is there in knowing the sequence position of this object in > scene.objects, where the order of the objects is not relevant? > It is relevant, as long as the sequence itself is relevant. Let's say that I'm taking GPS readings at regular intervals, marking a route, then i draw those points in VPython, in the very same order they where taken. There are two ways I would like to access those points and getting any associated info to them: either merely pointing-and-clicking, Or navigate across the points sequence using keys defined as "Next" or "Previous". In the last case, since those points belong to a route, it is desirable to jump from point to point in the original order, either backwards or forward. Best regard, Roberto. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |