There's something wrong with the program you posted:
Traceback (most recent call last):
File "C:\Documents and Settings\Bruce\My Documents\Python
stuff\vspace.py", line 279, in -toplevel-
ship.animate(period, len(asteroids))
File "C:\Documents and Settings\Bruce\My Documents\Python
stuff\vspace.py", line 121, in animate
self.status.text = 'frame rate = %i, asteroids = %s' \
ZeroDivisionError: float divmod()
Also, I'll note that you have the following:
scene.range = (0, 0, 0)
scene.scale = (.1, .1, .1)
The scene.range statement is irrelevant, because the scene.scale
statement is equivalent to scene.range = (10,10,10). But in the beta
version setting the range to 0 gives an error, as it should; it's a
failing in the production version not to give an error.
Bruce Sherwood
Ron Adam wrote:
>
> I made some changes to the VSpace.py Demo I posted earlier.
>
> Velocities are now time based instead of frame based, so that things
> should appear to move at the same speed on different speed computers.
>
> The frame rate is limited by adding and removing asteroid objects. So
> the number of asteroid objects acts as a rough bench mark. On my system
> I get 220 asteroids at 60 FPS. Your mileage may vary of course. ;-)
>
> Rotation of the world is done all at once by rotating the parent "space"
> frame instead of rotating frames individually.
>
> You can zoom in and out of the field of view by pressing both mouse
> buttons at the same time. This allows you to see how everything moves
> relative to the view. This was disabled before.
>
> The objects, asteroids, sun, stars, ship, are implemented with classes
> with an "animate" method. This groups related code together in a much
> nicer way.
>
>
> Enjoy,
> Ron Adam
|