|
From: Phlip <ppl...@om...> - 2002-04-17 18:23:27
|
Phlip sez:
> I'm auditioning 3D graphics libraries, and need to demonstrate VPython
> showing an Archimedian Solid. I can't find an examples on the net; what's
> the most rudimentary one possible?
Here ya go:
from visual import frame, rate, convex
points = ( (0, 0.771, 0.257), (0.727, 0.257, -0.257), (
0.364, 0.514, -0.514), (0, 0.257, 0.771), (
-0.364, 0.514, 0.514), (-0.364, -0.514, -0.514), (
0, -0.771, 0.257), (-0.727, -0.257, 0.257), (
0.364, 0.514, 0.514), (0.727, -0.257, -0.257), (
0.727, 0.257, 0.257), (0, 0.257, -0.771), (
0.727, -0.257, 0.257), (-0.364, 0.514, -0.514), (
-0.727, 0.257, 0.257), (0.364, -0.514, -0.514), (
-0.727, -0.257, -0.257), (0, 0.771, -0.257), (
0, -0.771, -0.257), (-0.727, 0.257, -0.257), (
0, -0.257, -0.771), (0.364, -0.514, 0.514), (
-0.364, -0.514, 0.514), (0, -0.257, 0.771), )
f = frame()
a = convex(color = (0.9,0.1,0.8), frame = f)
for t in points:
a.append(pos = t)
while 1:
rate(100)
f.rotate(angle=0.01)
Next question - can we make it glass? ;-)
--
Phlip
http://www.greencheese.org/DontPlanDesigns
"I love deadlines. I love the whooshing sound they make as they fly
by." -- Douglas Adams
|