|
From: Phlip <ppl...@om...> - 2002-04-16 20:24:17
|
VPython users:
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?
--
Phlip
http://www.greencheese.org/SpringPicnicZero
-- "In my experience, the customer doesn't know what he wants
until you don't give it to him." --David Brady --
|
|
From: Phlip <ppl...@om...> - 2002-04-16 22:48:07
|
VPython users:
I'm auditioning 3D graphics libraries, and need to demonstrate VPython
grafted into a Frame. The rest of our UI is Tkinter (and uses
multidimensional data), and a window floating over it revealing this data
would damage the user's experience. I can't find an examples on the net; so
(once again ;-) what's the most rudimentary one possible?
--
Phlip
http://www.greencheese.org/MayorZogg
"Education is an admirable thing, but it is well to remember that
nothing that is worth knowing can be taught." -- Oscar Wilde
|
|
From: Bruce S. <ba...@an...> - 2002-04-17 01:05:53
|
This is only an educated guess, but I don't think it's possible to put a Visual display into a Tkinter window, because Visual uses OpenGL for its graphics. Bruce Sherwood --On Tuesday, April 16, 2002 2:44 PM -0700 Phlip <ppl...@om...> wrote: > I'm auditioning 3D graphics libraries, and need to demonstrate VPython > grafted into a Frame. The rest of our UI is Tkinter (and uses > multidimensional data), and a window floating over it revealing this data > would damage the user's experience. I can't find an examples on the net; > so (once again ;-) what's the most rudimentary one possible? |
|
From: Phlip <ppl...@om...> - 2002-04-17 01:41:27
|
[Why is this list server set so Reply goes to individuals instead of the list? That is so lame!!] Bruce Sherwood sez: > This is only an educated guess, but I don't think it's possible to put a > Visual display into a Tkinter window, because Visual uses OpenGL for its > graphics. PyOpenGL does it via TOGL. The ideal library for us would have all VPython's features, the ability to just render into a Tk window and eat user inputs, and an easy pass-thru straight to PyOpenGL. Yes, I know VPython wraps OpenGL directly. My problem is I have colleagues who are too smart for their own good; they will cheerfully code some complex geometric display using raw PyOpenGL calls in hideously long functions, not recognizing Assembler for what it is. I want to support their efforts, but I also want objects! -- Phlip http://www.greencheese.org/PhilosophyBrethrenThree -- Friends don't let friends use Closed Source software -- |
|
From: Phlip <ppl...@om...> - 2002-04-17 18:59:24
|
Phlip sez:
> VPython users:
>
> I'm auditioning 3D graphics libraries, and need to demonstrate VPython
> grafted into a Frame. The rest of our UI is Tkinter (and uses
> multidimensional data), and a window floating over it revealing this data
> would damage the user's experience. I can't find an examples on the net; so
> (once again ;-) what's the most rudimentary one possible?
VPython wraps Gtk and gtkglarea, so this appears problematic. I will now be
Googling for such inanities as "put a Gtk widget into a Tk window".
--
Phlip
http://www.greencheese.org/PeaceAndCalm
"Remember always that you not only have the right to be an
individual, you also have an obligation to be one." -- Eleanor
Roosevelt
|
|
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
|
|
From: Bruce S. <ba...@an...> - 2002-04-17 19:00:59
|
Nice polyhedron. You can improve the appearance by inserting this line just before the while: a.display.autoscale = 0 Without it, with this particular solid, Visual's attempt to autoscale is incorrectly making small adjustments to the camera position. Nope, no glass yet. Transparency and real time are somewhat incompatible and require a major restructuring of Visual. Bruce Sherwood |