You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(15) |
Oct
(32) |
Nov
(35) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(46) |
Feb
(22) |
Mar
(65) |
Apr
(49) |
May
(22) |
Jun
(29) |
Jul
(51) |
Aug
(34) |
Sep
(32) |
Oct
(46) |
Nov
(30) |
Dec
(32) |
2002 |
Jan
(48) |
Feb
(4) |
Mar
(20) |
Apr
(28) |
May
(13) |
Jun
(34) |
Jul
(51) |
Aug
(15) |
Sep
(15) |
Oct
(35) |
Nov
(15) |
Dec
(20) |
2003 |
Jan
(31) |
Feb
(111) |
Mar
(41) |
Apr
(28) |
May
(36) |
Jun
(29) |
Jul
(27) |
Aug
(29) |
Sep
(47) |
Oct
(28) |
Nov
(7) |
Dec
(26) |
2004 |
Jan
(44) |
Feb
(9) |
Mar
(17) |
Apr
(26) |
May
(58) |
Jun
(13) |
Jul
(44) |
Aug
(64) |
Sep
(30) |
Oct
(11) |
Nov
(21) |
Dec
(28) |
2005 |
Jan
(29) |
Feb
(11) |
Mar
(11) |
Apr
(22) |
May
(85) |
Jun
(46) |
Jul
(17) |
Aug
(18) |
Sep
(14) |
Oct
(22) |
Nov
(1) |
Dec
(45) |
2006 |
Jan
(20) |
Feb
(36) |
Mar
(18) |
Apr
(24) |
May
(21) |
Jun
(48) |
Jul
(23) |
Aug
(20) |
Sep
(10) |
Oct
(41) |
Nov
(46) |
Dec
(40) |
2007 |
Jan
(40) |
Feb
(20) |
Mar
(13) |
Apr
(6) |
May
(24) |
Jun
(31) |
Jul
(30) |
Aug
(11) |
Sep
(11) |
Oct
(10) |
Nov
(56) |
Dec
(64) |
2008 |
Jan
(64) |
Feb
(22) |
Mar
(63) |
Apr
(28) |
May
(25) |
Jun
(36) |
Jul
(11) |
Aug
(9) |
Sep
(14) |
Oct
(41) |
Nov
(46) |
Dec
(130) |
2009 |
Jan
(95) |
Feb
(41) |
Mar
(24) |
Apr
(35) |
May
(53) |
Jun
(67) |
Jul
(48) |
Aug
(48) |
Sep
(86) |
Oct
(75) |
Nov
(64) |
Dec
(52) |
2010 |
Jan
(57) |
Feb
(31) |
Mar
(28) |
Apr
(40) |
May
(25) |
Jun
(42) |
Jul
(79) |
Aug
(31) |
Sep
(49) |
Oct
(66) |
Nov
(38) |
Dec
(25) |
2011 |
Jan
(29) |
Feb
(18) |
Mar
(44) |
Apr
(6) |
May
(28) |
Jun
(31) |
Jul
(36) |
Aug
(24) |
Sep
(30) |
Oct
(23) |
Nov
(21) |
Dec
(27) |
2012 |
Jan
(14) |
Feb
(11) |
Mar
(2) |
Apr
(48) |
May
(7) |
Jun
(32) |
Jul
(22) |
Aug
(25) |
Sep
(31) |
Oct
(32) |
Nov
(21) |
Dec
(17) |
2013 |
Jan
(44) |
Feb
(27) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(5) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bruce S. <bas...@un...> - 2003-02-11 20:23:46
|
From: "John Keck" <joh...@ho...> > Bruce, thanks for your reply about implementing new shapes. I can't > understand the difficulty in implementing opacity for shapes. Wouldn't you > just change the color value under the one you're plotting, instead of > replacing it? Comments from David Scherer: 2000 Nov. 3: OpenGL implements alpha rendering, but transparency places severe restrictions on the rendering pipeline. In particular objects need to be drawn in back-to-front order, which is not necessary for opaque objects thanks to Z buffering. Implementing transparency in an environment as unrestrictive as Visual without exposing the additional complexity to the user is not (quite) trivial. 2001 Feb. 27: > >Alpha is harder, because to render translucent surfaces accurately, you > need > >to draw them from back to front. At present, Visual doesn't need to sort > >most primitives (because they are drawn opaquely, and can be zbuffered). > If > >you want to attack this, I can give you some pointers - but it will take > >some effort. > I've been having a little fun playing with adding an "opacity" > attribute to > visual objects and have noticed that I need to control the order in which > objects are drawn. > > David, would you please explain what needs to be done to get the ordering > right? I might want to tackle this. Because Visual is a very general renderer, this is challenging to get exactly right. I can't give you a full specification right now, but I can discuss some of the issues. First of all, the reason that render order matters for translucent objects: Cs = RGB color on screen (framebuffer) Co = RGB color of object a = alpha of object Rendering one object: Cs = Co*a + Ci*(1-a) Rendering two objects: Cs = Co2*a2 + ( Co1*a1 + Ci*(1-a1) )*(1-a2) = Co2*a2 + Co1*a1*(1-a2) + Ci*(1-a1)*(1-a2) Substituting Co1 for Co2 and a1 for a2 in this equation yields a different result, so alpha rendering is order dependent. The correct order is back-to-front, as intuition would suggest. Distant objects are drawn, and nearby objects are drawn over them (transparently). So, the rendering process looks like: 1. Draw all opaque objects, in any order 2. Draw all transparent objects, from most distant to least distant. More precisely, when each pixel is drawn to the screen, it must overwrite only more distant objects. How to accomplish (2)? The first thing that jumps to your mind is something like: transparent = [] for obj in objects: if obj.opacity==1: draw(obj) else: transparent.append( (Z_value_of(obj), obj) ) transparent.sort() transparent.reverse() for obj in transparent: draw(obj) The first question that comes up is how to choose a Z value for an object that isn't a point: the nearest point? The farthest? The center? Here is a case where none of these will work: B 5 A/ 4 file://C 3 /// 2 / / Z=1 / ^ CAMERA The correct ordering is ABC. Nearest, farthest, and middle Z orderings all give BAC! Worse, consider that the objects might be intersecting: \ / X / \ ^ CAMERA And even nonintersecting triangles may not have an ordering: http://www.bath.ac.uk/~ensab/G_mod/FYGM/Gif/ren1f3.gif These problems can be solved for triangles, but the solution involves things like clipping. Solving it for entire Visual primitives seems impractical, so we would have to do something like: 1. Render all opaque objects 2. Break all transparent objects into triangles, and store the triangles 3. Find any pairs of triangles not separated by a plane and split them 4. Sort the triangles (using separating planes) 5. Render the triangles If you want to do some research on the topic, you will usually see it referred to as "Painter's algorithm" or "depth sorting". |
From: John K. <joh...@ho...> - 2003-02-11 19:37:24
|
Here's the actual code for "Shoot the Monkey," in case you have problems getting it off the web. JK # The classic Shoot-the-Monkey Demo # John W. Keck, February 2003 # American University # # camera direction still jerky: # should monkey be the center? from visual import * # define exx marker newframe = frame class exx(object): def __init__(self, frame=None, pos=(0,0,0), axis=(1,0,0), color=(1.0,0.5,0)): self.frame = newframe(pos=pos, axis=axis, frame=frame) self.__pos = vector(pos) self.__axis = vector(axis) self.__color = color # self.parts = box(frame=self.frame,axis=(1,1,0),size=(2,0.2,1),color=self.__color) box(frame=self.frame,axis=(1,-1,0),size=(2,0.2,1),color=self.__color) def getpos(self): return self.__pos def setpos(self, pos): self.frame.pos = self.__pos = vector(pos) pos = property(getpos, setpos) def getaxis(self): return self.__axis def setaxis(self, axis): # scale all points in front face self.frame.axis = self.__axis = vector(axis) length = mag(self.__axis) axis = property(getaxis, setaxis) def getcolor(self): return self.__color def setcolor(self, color): self.__color = color self.faces.color = color color = property(getcolor, setcolor) #----------------------------------------------------------------------- # set defaults and initial parameters color.orange = (1,0.5,0) color.brown = (0.46,0.28,0.10) v0 = 30.0 # default ball speed mkht = 135 # default monkey height ballpos = vector(-45,10,0) # default ball position dt = 0.01 # time increment for action calculation #------------------------------- mkpos = (47,mkht,0) scene = display(title="Shoot the Monkey", center=mkpos, ambient = 0.4, x=0, y=0, width=500,height=500) rt = int(1/dt) # limiting rate of action loop first = 1 # first run flag while 1: #---------------------------------------------------------------------- #SET THE STAGE mkpos = vector(47,mkht,0) scene.center = mkpos #set up the environment floor = box (pos=(10,0,0), size=(110,0.5,6), color=color.green, opacity=0.5) #length=110, height=0.5, width=6, color=color.green) tree = cylinder(pos=(60,0,0), axis=(0,mkht,0), radius=3, color=(0.7,0.7,0.3)) branch = cylinder(pos=(60,mkht-17,0), axis=(-12,30,0), radius=2, color=(0.7,0.7,0.3)) # power bar for selecting velocity # pinstr = frame() i = 0 while i < 5: pwr0 = box(pos=(-55,i*20+5,-10), size=(4.9,10,4.9), color=(0.8,0.8,0.5)) ## label(frame=pinstr,text=str(i*20), pos=(i*20,0,10), height=8) pwr1 = box(pos=(-55,i*20+15,-10), size=(4.9,10,4.9), color=color.yellow) i += 1 ## label(frame=pinstr,text=str(i*20), pos=(i*20,0,10), height=8) ## pinstr.pos = (-62,0,0) ## pinstr.axis = (0,1,0) ## pinstr.visible = 0 power1 = box(pos=(-55,v0/2,-10), size=(5,v0,5), color=color.red) pwr = label(pos=(-62,v0,0), height=12, visible=1) pwr.text = '%0.1f' % (v0) #the monkey # mkcolor = (1,0.7,0.2) mkcolor = color.brown monkey = frame() sphere(frame=monkey, pos=(1,0,0),radius=2,color=mkcolor) #head sphere(frame=monkey, pos=(0.6,0,-1.9),radius=1.2,color=(1,0.8,0.5)) #snout sphere(frame=monkey, pos=(1.5,0.12,-2.3),radius=0.2,color=color.black) #nostrils sphere(frame=monkey, pos=(1.5,-0.12,-2.3),radius=0.2,color=color.black) ring(frame=monkey, pos=(0.7,0,-2.2),axis=(2,0,-1),radius=0.9,thickness=0.2,color=color.black) # mouth eang0 = 65*pi/180 eang1 = 20*pi/180 sphere(frame=monkey, pos=(1+1.5*cos(eang0),1.5*sin(eang0)*sin(eang1),-1.5*sin(eang0)*cos(eang1)),radius=0.6,color=(0.9,0.9,0.9)) #eyes sphere(frame=monkey, pos=(1+1.5*cos(eang0),-1.5*sin(eang0)*sin(eang1),-1.5*sin(eang0)*cos(eang1)),radius=0.6,color=(0.9,0.9,0.9)) #eyes eang0 = 67*pi/180 eang1 = 19*pi/180 sphere(frame=monkey, pos=(1+2.02*cos(eang0),2.02*sin(eang0)*sin(eang1),-2.02*sin(eang0)*cos(eang1)),radius=0.2,color=color.black) #eyes sphere(frame=monkey, pos=(1+2.02*cos(eang0),-2.02*sin(eang0)*sin(eang1),-2.02*sin(eang0)*cos(eang1)),radius=0.2,color=color.black) #eyes ## eang0 = 70*pi/180 ## eang1 = 90*pi/180 ## cone(frame=monkey, pos=(1+2.3*cos(eang0),2.3*sin(eang0)*sin(eang1),-2.3*sin(eang0)*cos(eang1)),axis=(-0.5*cos(eang0),-0.5*sin(eang0)*sin(eang1),0.5*sin(eang0)*cos(eang1)),radius=0.3,color=mkcolor) ## cone(frame=monkey, pos=(1+2.3*cos(eang0),-2.3*sin(eang0)*sin(eang1),-2.3*sin(eang0)*cos(eang1)),axis=(-0.5*cos(eang0),0.5*sin(eang0)*sin(eang1),0.5*sin(eang0)*cos(eang1)),radius=0.3,color=mkcolor) cylinder(frame=monkey, pos=(-6,0,0), axis=(5,0,0), radius=2, color=mkcolor) #body monkey.pos = mkpos monkey.axis = (0,1,0) monkey.velocity = vector(0,0,0) monkey.trail = curve(color=mkcolor) monkey.mass = 5 #the ball ball = sphere (pos=ballpos, radius=1, color=(0.4,0.9,1)) ball.mass = 1 ball.trail = curve(color=ball.color) bpos = label(pos=ballpos, visible=0) bpos.text = '%0.1f, %0.1f' %(ball.pos.x, ball.pos.y) # take aim aim = curve(pos=[ball.pos,monkey.pos+monkey.axis], color=(0.9,0.7,0.7)) dist = mag(ball.pos-monkey.pos) cx = (monkey.x - ball.x)/dist cy = (monkey.y - ball.y)/dist ball.velocity = vector(v0*cx,v0*cy,0) vel = arrow(pos=ball.pos, axis=ball.velocity/4, shaftwidth=1, fixedwidth=1, color=color.yellow) masstot = ball.mass + monkey.mass # TEXT INSTRUCTIONS print print "======================================" print "Shoot-the-Monkey Physics Demonstration" print "Written by John W. Keck 2003" if first: instr = label(text='Answer question in text\nwindow to continue.', pos=scene.center+vector(0,scene.range.y,0), height=12) print print "Consider the situation depicted here. A gun is accurately aimed at a monkey" print "hanging from a tree. The target is well within the gun's range, but the" print "instant the gun is fired and the bullet moves with a speed v0, the monkey" print "lets go and drops to the ground. What happens? The bullet" print print "1. hits the monkey regardless of the value of v0, as long as he doesn't" print " hit the ground first." print "2. hits the monkey only if v0 is large enough for the bullet to reach" print " him before he falls much more than the length of his body." print "3. misses the monkey entirely." print # comment out the following line if it gets annoying answer = input("Which (1-3)?") print print "Try shooting the ball at difference speeds from various places" print "to discover the answer." print print "At 1-second intervals, the computer will plot measures showing" print "how far each body has fallen." first = 0 instr.visible = 0 while scene.mouse.events: xx = scene.mouse.getevent() # clear mouse buffer print print "=== INSTRUCTIONS ===" print "Drag Ball to position Ball" print "Drag power bar at left to change initial velocity" print "Drag tree to position Monkey" print "Click background to FIRE" print #---------------------------------------------------------------------- # AIMING STAGE pick = None go = 1 while go: if scene.mouse.events: m1 = scene.mouse.getevent() # obtain drag or drop event if m1.drag and m1.pick == ball: drag_pos = m1.pickpos pick = m1.pick scene.cursor.visible = 0 # make cursor invisible elif m1.drop: pick = None # end dragging scene.cursor.visible = 1 # cursor visible if m1.drag and m1.pick == power1: drag_pos = m1.pickpos pick = m1.pick scene.cursor.visible = 0 # make cursor invisible elif m1.drop: pick = None # end dragging scene.cursor.visible = 1 # cursor visible if m1.drag and m1.pick == tree: drag_pos = m1.pickpos pick = m1.pick scene.cursor.visible = 0 # make cursor invisible elif m1.drop: scene.center = monkey.pos # jerky, but workable pick = None # end dragging scene.cursor.visible = 1 # cursor visible if scene.mouse.clicked: m = scene.mouse.getclick() print "FIRE!" go = 0 if pick==ball: new_pos = scene.mouse.project(normal=(0,0,1)) if new_pos != drag_pos: pick.pos += new_pos - drag_pos drag_pos = new_pos dist = mag(ball.pos-monkey.pos) cx = (monkey.x - ball.x)/dist cy = (monkey.y - ball.y)/dist ball.velocity = vector(v0*cx,v0*cy,0) vel.axis = ball.velocity/4 vel.pos = ball.pos aim.pos = [ball.pos,monkey.pos+monkey.axis] if pick==power1: new_pos = scene.mouse.project(normal=(0,0,1)) if new_pos != drag_pos: pick.height += new_pos.y - drag_pos.y v0 = pick.height if v0 > 100: v0 = 100 if v0 < 0: v0 = 0 pick.height = v0 ball.velocity = vector(v0*cx,v0*cy,0) vel.axis = ball.velocity/4 vel.pos = ball.pos power1.y = v0/2 pwr.pos=(-62,v0,0) pwr.text = '%0.1f' % (v0) drag_pos = new_pos if pick==tree: new_pos = scene.mouse.project(normal=(0,0,1)) if new_pos != drag_pos: pick.axis.y += new_pos.y - drag_pos.y h = pick.axis.y if h > 300: h = 300 if h < 17: h = 17 pick.axis.y = h # pick.y = 0 monkey.pos.y = h # scene.center = monkey.pos # makes it hard to control branch.pos.y = h - 17 dist = mag(ball.pos-monkey.pos) cx = (monkey.x - ball.x)/dist cy = (monkey.y - ball.y)/dist ball.velocity = vector(v0*cx,v0*cy,0) vel.axis = ball.velocity/4 vel.pos = ball.pos aim.pos = [ball.pos,monkey.pos+monkey.axis] drag_pos = new_pos print "Initial velocity = %0.2f m/s at %0.2f degrees" %(v0,atan(cy/cx)*180/pi) print "Initial position = (%0.2f, %0.2f)" % (ball.x,ball.y) ballpos.x = ball.pos.x #save for next time round ballpos.y = ball.pos.y mkpos.y = monkey.pos.y # mkpos0.y = mkpos.y # find params of line that ball would have travelled without gravity slope = (ball.pos.y-monkey.pos.y)/(ball.pos.x-monkey.pos.x) yint = ball.pos.y - slope*ball.pos.x sphere(pos=monkey.pos,color=color.orange,radius=1.0) # pwr.visible = 0 # clear mouse event buffer while scene.mouse.events: xx = scene.mouse.getevent() #---------------------------------------------------------------------- # ACTION STAGE #aim.visible = 0 g = 9.8 t = 0 relvel0 = vector(0,0,0) bpos0 = ball.pos go = 1 nohit = 1 b1 = 0 d0 = 0.5*g # standard distance (same for both Monkey and Ball) while go or nohit: rate (rt) # change ball and monkey positions and velocities for free fall ball.velocity.y -= g*dt ball.pos += ball.velocity*dt monkey.velocity.y -= g*dt monkey.pos += monkey.velocity*dt scene.center = monkey.pos if monkey.x > tree.x-tree.radius-1: ball.velocity.x = -0.8*ball.velocity.x if ball.x > monkey.x + 10: go = 0 nohit = 0 if monkey.y <= 6 : go = 0 # leave trails and show ball's velocity vector vel.pos = ball.pos vel.axis = ball.velocity/4 ball.trail.append(pos=ball.pos) if not nohit: monkey.trail.append(pos=monkey.pos+monkey.axis/2) # print t,fmod(t,1) # plot measurement bars to show how fall objects have fallen # (The distances don't exactly fall on perfect squares because # of the limited precision of the calculation; # as dt -> 0, results improve.) t += dt if t>(1.0-dt) and nohit: projy = slope*ball.x + yint projpos = vector(ball.x, projy, 0) sphere(pos=mkpos,color=color.orange,radius=1.0) sphere(pos=projpos,color=color.orange,radius=1.0) exx(pos=ball.pos) d = (projy - ball.pos.y) xx = d/d0/2 i = 0 while i<xx: b = projpos-vector(0,2*i*d0,0) b2 = mkpos-vector(0,2*i*d0,0) curve(pos=[b,b-vector(0,d0,0)],color=color.orange) curve(pos=[b2,b2-vector(0,d0,0)],color=color.orange) if (2*i+1)*d0<d: curve(pos=[b-vector(0,d0,0),b-vector(0,2*d0,0)],color=(0.5,0,0.5)) curve(pos=[b2-vector(0,d0,0),b2-vector(0,2*d0,0)],color=(0.5,0,0.5)) i += 1 # curve(pos=[projpos,ballpos],color=color.orange) ## sphere(pos=monkey.pos,color=color.orange,radius=1.0) exx(pos=monkey.pos) t = 0 b1 += 1 # monkey-ball collision if nohit and (ball.x > monkey.x-2 and ball.x < monkey.x+2) and (ball.y > monkey.y-5 and ball.y < monkey.y+2): relvel = mag(monkey.velocity - ball.velocity) print "BLAM! Ball hits Monkey at %0.2f m/s" % (relvel) print print "Notice how the Monkey and the Ball" print "fell equal distances in equal time intervals." # perfectly inelastic collision ball.velocity.x = (ball.mass*ball.velocity.x + monkey.mass*monkey.velocity.x)/masstot ball.velocity.y = (ball.mass*ball.velocity.y + monkey.mass*monkey.velocity.y)/masstot monkey.velocity = ball.velocity nohit = 0 # pause option if scene.mouse.clicked: m = scene.mouse.getclick() instr = label(text=' --PAUSED--\nClick to continue', pos=scene.center, height=12) m = scene.mouse.getclick() instr.visible = 0 # wait for user before going back to beginning while scene.mouse.events: xx = scene.mouse.getevent() # clear mouse buffer instr = label(text=' ---DONE---\nClick to re-run', pos=scene.center, height=12) m = scene.mouse.getclick() for obj in scene.objects: obj.visible = 0 _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail |
From: John K. <joh...@ho...> - 2003-02-11 15:53:41
|
I've written a little demo of the classic physics demonstration "Shoot the Monkey." It is available from this page: http://unix.cap.american.edu/~jwk/class/monkeyshoot.html Bruce, thanks for your reply about implementing new shapes. I can't understand the difficulty in implementing opacity for shapes. Wouldn't you just change the color value under the one you're plotting, instead of replacing it? Thanks also to Shuan for his instructions about hacking your own shapes into the C++ code. I wish I had time to work on developing the VPython library (it's fun stuff), but at present I'm overbooked with a full teaching load, as well as a job search for after the semester. In case anyone else out there has the time. Other ideas for shapes to implement are the Platonic solids. Other ideas you might grab from the COG radiation transport package, which implements a pretty complete set of space-bounding surfaces. The manual is available here: http://www-phys.llnl.gov/N_Div/COG/Manual/COG_ToC.html Look under the "SURFACES Data Block" section about a fifth of the way down the page. JK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus |
From: Bruce S. <bas...@un...> - 2003-02-11 05:14:36
|
Shaun Press has contributed chessboard.py to the new user programs area of the VPython web site. It looks very nice! It doesn't actually play chess, though it will execute moves that you give it (without checking whether they're legal). Thanks, Shaun! Bruce Sherwood |
From: Press, S. <sha...@ai...> - 2003-02-10 22:33:33
|
This is based on my own attempts at building a frustum, which BTW may not be the best choice of name as 'frustum' in OpenGL refers to the Perspective Viewing Volume and therefore turns up in the source in another context. This was done under RedHat Linux 7.3 and both VPython and Python 2.2.1 were local copies rather than system installations 1. Use the source, Luke 2. It is easier to modify then write your own 3. Find an existing primative to base your shape on. In the case of a frustum, the cone shape is the best bet 4. Copy cone.cpp to frustum.cpp 5. Change references to 'cone' to 'frustum' in fustrum.cpp 6. Modify how the shape is to be drawn (I'm not going to go into detail on this as I haven't got it quite right yet!) 7. Edit cvisual.cpp to include the frustum command. The easiset way to do this is to find every reference to cone and add an identical reference using the word frustum instead of cone 8. Edit Makefile and add fustrum.cpp to the list of source files 9. Find the directory site-packages/visual in the source tree. Modify __init__.py to include the label frustum. Again, just look for cone and add fustrum at that point. 10. Run make 11. If you are building against the system installation, run make install. If not copy cvisualmodule.so to <local python dir>/Lib .Copy the modified __init__.py file into the <local python dir>/Lib/site-packages/visual directory. If you do not do this, the attempts to run frustum() under python will return an error 12. Test by starting python from visual import * f = frustum() If something appears, great. If an error is returned, check that the site-package/visual directory is in sys.path. If not use sys.path.insert(2,<site package path>) to add it to sys.path (don't forget to import sys before you do this) The way David Scherer wrote Visual Python makes building simple shapes pretty easy. You can get by with a minimal knowldege of OpenGL as the source is fairly easy to follow. Obvious question:Have I built a frustum? Sort of. I have made something that looks like one, but It isn't quite what I think people want. I should have better results in the next couple of days, when I improve the shape generation (step 6) Other shapes that should be fairly easy to make include Pyramids, domes, eggs, diamonds and maybe non-rectangular prisms |
From: Joe H. <hea...@vn...> - 2003-02-10 20:49:04
|
I'm relaying this from William Scott at UCSC: Well, I got ghtlarea installed with fink, and I already had numeric installed with fink, so next I went to the directory called ../VPython/cvisual and, following what is being done in the install file, I manually issued make: The next problem that arose is this: (% is my tcsh prompt). % cp Makefile.MacOSX Makefile % make cc -g -I. -I./CXX/Include -I/sw//include/python2.2 -I/sw//include/python2.2/Numeric -I/sw/include/gtk-1.2 -I/sw/include/glib-1.2 -I/sw/lib/glib/include -D_REENTRANT -I/usr/X11R6/include -I/System/Library/Frameworks/OpenGL.framework/Headers -I/sw//include/glib-1.2 -I/sw//include -w -c -o arrow.o arrow.cpp In file included from pvector.h:6, from cvisual.h:6, from display.h:5, from prim.h:5, from axial.h:5, from arrow.cpp:1: CXX/Include/CXX_Objects.h:967: no class template named `random_access_iterator' in `std' CXX/Include/CXX_Objects.h:1077: no class template named `random_access_iterator ' in `std' make: *** [arrow.o] Error 1 % Any ideas as to how to deal with this? Cheers, Joe Heafner ----- The ONLY way to stop computer viruses is to STOP using Microsoft products, openly known as viral petri dishes. Why don't you all get this? |
From: Bruce S. <bas...@un...> - 2003-02-10 15:02:53
|
Recently there has been a flurry of reports of problems trying to compile Visual and get VPython working on recent versions of Linux, and on the new X11 environment available on Mac OSX 10.2. I haven't been able to study the problems myself yet, but I will summarize the reports here. Those users who have written to me personally but are not subscribed to the VPython user list may wish to subscribe to participate more fully in whatever mutual aid there is within the community. From Kevin Cole came a note that seems to address the issue about "random_access_iterator": I had VPython working fine on my 7.2 system, but had a few minor glitches getting it going on the RH 8.0 Beta after returning from the Tech Circus last weekend. In my case, the fixes (after downloading the latest and greatest from vpython.org) were: 1) Make sure C++ is installed. (As I recall, in 8.0, the package name changes from "gcc-c++" to "gcc-cpp" but I won't swear to it. You can check w/ the command "rpm -q gcc-cpp" and/or "rpm -q gcc-c++" assuming you've installed it using RPM.) 2) Get the Mandrake Numeric RPM. Pretty current, and it installs no fuss, no muss. 3) As the documentation suggests, make sure you know where all your python stuff lives. Red Hat doesn't put any of it in /usr/local. So rip "/local" out wherever you see it. (I can't recall, but I think there was somewhere that I had to remove it that wasn't mentioned in the documentation. 4) In my case, I had to change cvisual/CXX/CXX_Config.h, as suggested by the README.htm in that directory -- though I was a bit surprised, considering the date mentioned: ================================================================ Version 3 (June 18, 1999) 1. CXX compiles with EGCS snapshot 19990616. EGCS requires a standard library class random_access_iterator that is not yet available in some other compilers (such as Windows VC6). Therefore a new switch: STANDARD_LIBRARY_HAS_ITERATOR_TRAITS has been added to CXX_Config.h that you may need to toggle if you get an error on the two lines that mention random_access_iterator. The current definition is correct for VC6 and EGCS-19990616. ================================================================ Sven Glatthaar reported: Impressed by the capabilities of vpython I would like to run it using Redhat 8.0. After fixing the "random_access_iterator"-problem as it is described in the archive of this mailing list and running the install-script successfully another bug occured: < Visual-2002-07-22 Traceback (innermost last) File "/usr/share/python-visual/Programs/Demos/bounce.py", line 1, in ? from visual import * ImportError: /usr/lib/libgtkgl.so.5: undefined symbol: glXUseXFont Program disconnected. > As far as I understand libgtkgl.so.5 is part of the gtkglarea-1.2.2-10.i386.rpm or gtkglarea-1.2.2-10.src.rpm package. Even an update of this packages to release 13 doesn't help. Jonathan Brandmeyer offers this perspective on GTK: For background, GTK2.0 came out in June 2002, and is currently at version 2.2.1. Gtk1.x is considered obsolete, and the Linux community is migrating very rapidly to 2.x. More than one person has contributed the code to make GtkGLArea fully compliant with GTK2.x. However, every patch and code contribution to the tool has died. The general consensus on the mailing lists is that as of about September 2002, GtkGLArea is dead. However, a replacement is available: GtkGLExt. This library allows you to make *any* GTK widget capable of displaying OpenGL stuff. This project is under active development, is more complete with regard to GL support, has fewer bugs, and is compatible with Gtk2.x. The catch is that GtkGLExt is _not_ compatible with GTK1.2, and probably never will be. This means that older distributions will not be able to support the software, including the Linux setup that NCSU currently uses. Every current distribution of Linux uses GTK2.x today, so this may not be a serious problem for long. The added bonus is that GtkGLExt has a close cousin: GtkGLExtmm, a C++ class interface to the GL. Basically, if you want a window class that shows GL, you create a class that inherits from Gtk::GL::Widget and Gtk::Window, and POOF! You have a window widget that displays OpenGL. Extra bonus: Gtk and GtkGLExt run on MS Windows, too. Joe Heafner reported this concerning the Mac: You may be interested in the thread I started on VPython on 10.2 in the Mac OS X > Using Technologies > Unix discussion board on Apple's web site. Someone has tried compiling Visual under 10.2 and has come across some issues (too complicated for me to try to include here). Note that he edited the install script to not install numeric and to not create a .xinitrc file (Apple's X11 doesn't need one unless you use a window manager other than the default quartz-wm). |
From: Arthur <aj...@ix...> - 2003-02-09 19:40:11
|
> Is it possible to use Visual with Jython to produce applet-type things that > will run in a web browser? > > I want to produce simulations that can be viewed more widely, and I don't > want to have to learn java to do it. > > (I could figure out the answer to this on my own, but if someone already > knows that it's not possible, it would save me some hours of poking around > only to come up empty.) Not possible, as I see it. Without *a lot* of work. Because both Numeric and VPython itself are in C, and therefore not accessible to Jython. There had at one point been a partial port of Numeric to Java - probably complete enough for most needs related to VPython. But then there is the issue of the VPython code itself. In the perfect world, VPython code would be ported both to use the Bosst C++ library- one one hand, and to Java using some like GL4Java, on the other. In the end, the same Python code might be able to run both flavors. Would be wonderful. But this kind of effort behind a refractoring of VPython does not seem to be in the cards - by all signs. Art |
From: Bruce S. <bas...@un...> - 2003-02-09 18:14:25
|
I don't know whether this is possible, but I'm at least pretty sure that no one has done it. At the risk of stating the obvious, you can of course just put a VPython program on a web site and tell people to install VPython (just as you might have to tell them to install some plugin). Agreed though that it would be desirable to have a simple and direct scheme for playing VPython programs in a brower. Definitely on the wish list. Bruce Sherwood ----- Original Message ----- From: "Gary Pajer" <pa...@in...> To: <vis...@li...> Sent: Sunday, February 09, 2003 11:55 AM Subject: [Visualpython-users] jython / browser applets ? > Is it possible to use Visual with Jython to produce applet-type things that > will run in a web browser? > > I want to produce simulations that can be viewed more widely, and I don't > want to have to learn java to do it. > > (I could figure out the answer to this on my own, but if someone already > knows that it's not possible, it would save me some hours of poking around > only to come up empty.) > > -Gary > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Gary P. <pa...@in...> - 2003-02-09 16:56:52
|
Is it possible to use Visual with Jython to produce applet-type things that will run in a web browser? I want to produce simulations that can be viewed more widely, and I don't want to have to learn java to do it. (I could figure out the answer to this on my own, but if someone already knows that it's not possible, it would save me some hours of poking around only to come up empty.) -Gary |
From: Bruce S. <bas...@un...> - 2003-02-07 03:43:51
|
Currently there isn't a way to place text in a fixed position. Notice however that a "label" does continue to face you as you rotate the camera. Thom Ives initiated a module which creates some new objects: tube, frustum (a cone with the top cut off), and partial sphere. These were built using the low-level faces object. You can find this module in a new area of http://vpython.org for demo programs contributed by users. It would be lovely to have opacity for Visual objects, but this is very difficult to achieve with real-time rendering. It is feasible with labels because they are always in front. Bruce Sherwood ----- Original Message ----- From: "John Keck" <joh...@ho...> To: <vis...@li...> Sent: Thursday, February 06, 2003 7:51 PM Subject: [Visualpython-users] text placement in window space and future features > I'm wondering if it is possible to position text in 2-d window coordinates > (as opposed to the virtual 3-d coordinates that VPython usually uses). I > want to have some text that remains in the same position (the edge of the > window, say), even as the user rotates the scene and zooms, etc. Is there > any way to do this? > > Also, are there any other geometrical figures planned for VPython? For > example: ellipsoids, truncated cones, or non-rectangular prisms? If not, > how would one go about programming objects like these? (I'm taking the COG > monte-carlo package as a model here.) > > Another question about plans for VPython: are there any plans to implment > opacity for geometrical figures, as there is for labels? > > Thanks for any help you can provide. > > Sincerely, > > NV > > > _________________________________________________________________ > Add photos to your e-mail with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Bruce S. <bas...@un...> - 2003-02-07 03:43:33
|
Currently there isn't a way to place text in a fixed position. Notice however that a "label" does continue to face you as you rotate the camera. Thom Ives initiated a module which creates some new objects: tube, frustum (a cone with the top cut off), and partial sphere. These were built using the low-level faces object. You can find this module in a new area of http://vpython.org for demo programs contributed by users. It would be lovely to have opacity for Visual objects, but this is very difficult to achieve with real-time rendering. It is feasible with labels because they are always in front. Bruce Sherwood ----- Original Message ----- From: "John Keck" <joh...@ho...> To: <vis...@li...> Sent: Thursday, February 06, 2003 7:51 PM Subject: [Visualpython-users] text placement in window space and future features > I'm wondering if it is possible to position text in 2-d window coordinates > (as opposed to the virtual 3-d coordinates that VPython usually uses). I > want to have some text that remains in the same position (the edge of the > window, say), even as the user rotates the scene and zooms, etc. Is there > any way to do this? > > Also, are there any other geometrical figures planned for VPython? For > example: ellipsoids, truncated cones, or non-rectangular prisms? If not, > how would one go about programming objects like these? (I'm taking the COG > monte-carlo package as a model here.) > > Another question about plans for VPython: are there any plans to implment > opacity for geometrical figures, as there is for labels? > > Thanks for any help you can provide. > > Sincerely, > > NV > > > _________________________________________________________________ > Add photos to your e-mail with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: John K. <joh...@ho...> - 2003-02-07 00:51:50
|
I'm wondering if it is possible to position text in 2-d window coordinates (as opposed to the virtual 3-d coordinates that VPython usually uses). I want to have some text that remains in the same position (the edge of the window, say), even as the user rotates the scene and zooms, etc. Is there any way to do this? Also, are there any other geometrical figures planned for VPython? For example: ellipsoids, truncated cones, or non-rectangular prisms? If not, how would one go about programming objects like these? (I'm taking the COG monte-carlo package as a model here.) Another question about plans for VPython: are there any plans to implment opacity for geometrical figures, as there is for labels? Thanks for any help you can provide. Sincerely, NV _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail |
From: Sven G. <sve...@we...> - 2003-02-06 20:38:06
|
Hello, Impressed by the capabilities of vpython I would like to run it using Redhat 8.0. After fixing the "random_access_iterator"-problem as it is described in the archive of this mailing list and running the install-script successfully another bug occured: < Visual-2002-07-22 Traceback (innermost last) File "/usr/share/python-visual/Programs/Demos/bounce.py", line 1, in ? from visual import * ImportError: /usr/lib/libgtkgl.so.5: undefined symbol: glXUseXFont Program disconnected. > As far as I understand libgtkgl.so.5 is part of the gtkglarea-1.2.2-10.i386.rpm or gtkglarea-1.2.2-10.src.rpm package. Even an update of this packages to release 13 doesn't help. Can you help me, please? Sven |
From: Bruce S. <bas...@un...> - 2003-01-31 22:54:45
|
Alas, I have to reveal an unfortunate fact of life: There are no angels. Seriously, a major gap in VPython is that there is no way to import a 3D model from some other modeling package or format. The only thing you can do at present is use the low-level primitive object "faces" and create the object yourself out of shaded triangles. Or as you say approximate an angel by a sphere! Moreover, there is no transparency, a difficult effect to achieve in a real-time 3D renderer. As for flying through space carrying the camera, see the demo program stonehenge.py, where the basic idea is to keep moving scene.center to give the effect you want. Bruce Sherwood ----- Original Message ----- From: "Tom Munnecke" <mun...@st...> To: "'vpusers'" <vis...@li...> Sent: Friday, January 31, 2003 5:22 PM Subject: [Visualpython-users] Help for desiging a space i n Vpython. > I am new to Python and Vpython, but have really been impressed with what > I can do so simply. Instead of writing a "hello world" program, I > tweaked the random boxes demo program and created a grid to indicate a > space. One thing lead to another, and I am working up a whole scheme > called ProtoSpace. http://www.givingspace.org/protospace and the > program is at http://www.givingspace.org/protospace/space01.py > > I want to add agents, called Angels, which will fly around the space. > Does anyone know of an Angel figure, a cute little cherub figure with > flapping wings, that I could show flying around the space? I'd like to > also "lock on" to the angel, mounting the camera on the angels' back, > showing an angel's-eye view of the space. The wings would be visible, > but transparent, so as to not block the view. > > I don't really need a high res image, I suppose I could use a sphere > instead, but I am demonstrating this idea next week and would like to > spruce it up a little. > > Any help or pointers to anything related to this would be greatly > appreciated. > > Thanks... > > Tom Munnecke > Visiting Scholar > Digital Visions Program > Stanford University > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Tom M. <mun...@st...> - 2003-01-31 22:22:46
|
I am new to Python and Vpython, but have really been impressed with what I can do so simply. Instead of writing a "hello world" program, I tweaked the random boxes demo program and created a grid to indicate a space. One thing lead to another, and I am working up a whole scheme called ProtoSpace. http://www.givingspace.org/protospace and the program is at http://www.givingspace.org/protospace/space01.py I want to add agents, called Angels, which will fly around the space. Does anyone know of an Angel figure, a cute little cherub figure with flapping wings, that I could show flying around the space? I'd like to also "lock on" to the angel, mounting the camera on the angels' back, showing an angel's-eye view of the space. The wings would be visible, but transparent, so as to not block the view. I don't really need a high res image, I suppose I could use a sphere instead, but I am demonstrating this idea next week and would like to spruce it up a little. Any help or pointers to anything related to this would be greatly appreciated. Thanks... Tom Munnecke Visiting Scholar Digital Visions Program Stanford University |
From: Bruce S. <bas...@un...> - 2003-01-31 21:11:41
|
This sounds somewhat familiar. Can someone who has had experience with this issue on Linux comment? Thanks! I tried to post this with the attachments that Craig furnished, but it bounced back (message too big). If you need to see those documents, you could email him directly for copies. Bruce Sherwood ----- Original Message ----- From: "Craig Gallek" <cg...@an...> To: <bas...@un...> Sent: Friday, January 31, 2003 2:28 PM Subject: Vpython segmentation fault > > Hello, > > I am in the Chemistry and Computer Science departments at Carnegie > Mellon University. We use VPython in our research lab. I am having > some problems with the package and I was wondering who the current > developers of the project are. Your name was the only e-mail address > listed on the VPython web site. If I am contacting the wrong person, > please redirect me to the proper place. > > Up until about a week ago, VPython was working properly on our cluster. > We just updated our Linux machines last week. The upgrade included the > new versions of gtk2 and gcc 3.2. However, the old versions of gtk 1.2 > and gcc 2.95 are still on the machines as well. Certain function in > VPython now cause python to Segfault without displaying any > information. I tried recompiling the VPython library against the new > versions of the software that we had installed and against the old > versions, but the same thing happens. I have attached a gdb backtrace > and strace of a crash that occurs when the dot product function is > called on two unit vectors. I don't understand all of the 'file not > found' errors in the strace. These files are present and have the > proper permissions set. None of the python files were touched during > the upgrade, so I'm a bit stumped. Do you know of any complications > with VPython and the new versions of gtk and gcc? > > Any help would be greatly appreciated. > > Thank you, > Craig Gallek > |
From: Bruce P. <bap...@te...> - 2003-01-27 05:10:52
|
Bruce The examples you've been describing sound great -- unfortunately attached files don't make it through the listserver summary. Could these be made available on the web site? Thanks At 12:02 PM 1/26/2003, you wrote: >Send Visualpython-users mailing list submissions to > vis...@li... > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/visualpython-users >or, via email, send a message with subject or body 'help' to > vis...@li... > >You can reach the person managing the list at > vis...@li... > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of Visualpython-users digest..." > > >Today's Topics: > > 1. Re: cherry tree example (Gary Pajer) > >--__--__-- > >Message: 1 >Date: Sat, 25 Jan 2003 17:20:51 -0500 >From: Gary Pajer <pa...@in...> >Subject: Re: [Visualpython-users] cherry tree example >To: vpusers <vis...@li...> >Cc: Ferenczi Viktor <cx...@cx...> > >Wow. > > > > Viktor Ferenczi of Hungary has contributed another lovely demo program > > (attached). Using recursion, he generates a cherry tree and then has the > > leaves flutter in a gentle breeze. > > > > Bruce Sherwood > > > > > >--__--__-- > >_______________________________________________ >Visualpython-users mailing list >Vis...@li... >https://lists.sourceforge.net/lists/listinfo/visualpython-users > > >End of Visualpython-users Digest Bruce Peterson, Ph.D. Terastat, Inc Information Access Systems Voice (425) 466 7344 Fax (206) 350 3685 |
From: Gary P. <pa...@in...> - 2003-01-25 22:21:46
|
Wow. > Viktor Ferenczi of Hungary has contributed another lovely demo program > (attached). Using recursion, he generates a cherry tree and then has the > leaves flutter in a gentle breeze. > > Bruce Sherwood > |
From: Aaron T. <ti...@ma...> - 2003-01-25 17:02:20
|
I typically run VPython using xDarwin on Mac OS 10.2.3. I followed Steve Spicklemire's instructions found at the VPython web site although I had to do the following, as Bruce kindly posted on the VPython site: > Follow fink installation instructions for OSX 10.2 > > After installing xfree86-rootless and python (and the others), run the > following commands: > > fink update python > fink update xfree86-rootless > > Each of those updates will take a long time, so have a good book on > hand. When running the VPython install script, it may not ask you > about creating a .xinitrc file. Copy the file, xinitrc, in the VPython > folder to .xinitrc in your home directory. I have since also installed x11 as distributed by Apple. I can run VPython from within x11 although I do have a problem with the window manager. I can't move windows around and the menubars hide behind the x11 menubar. I guess my only suggestion is to get it working with Fink and xDarwin and then run it under Apple's x11. But if you do figure out the problem, please let us know. Thanks, AT On Saturday, January 25, 2003, at 10:58 AM, Joe Heafner wrote: > Hi. > I'm using Mac OS 10.2.3, Apple's implementation of X11 > <http://www.apple.com/x11/> based on XFree 4.2.1, Apple's X11 SDK, > Fink 0.5.1, and Visual-2002-07-22 from the VPython web site. > Everything installed properly with no errors. I forgot to become root > to run the VPython install script, but I ran it again as root. > Actually, I ran it again with "sudo" which worked under OS 10.1.5 and > Fink 0.4.1. > > Now, when I try to run any VPython program from IDLE, here's what I > get: > > -----begin error message > Visual-2002-07-22 > Traceback (innermost last) > File "/sw/share/python-visual/Programs/Demos/orbit.py", line 1, in ? > from visual import * > ImportError: Failure linking new module > > Program disconnected. > -----end error message > > This specific example was for orbit.py, but I get the same error with > any program, and I get the same error whether I run the program from > the ~/VPython/Programs/Demos folder or from the duplicate folder under > /sw. > > Any suggestions? > > Joe > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Joe H. <hea...@vn...> - 2003-01-25 15:58:28
|
Hi. I'm using Mac OS 10.2.3, Apple's implementation of X11 <http://www.apple.com/x11/> based on XFree 4.2.1, Apple's X11 SDK, Fink 0.5.1, and Visual-2002-07-22 from the VPython web site. Everything installed properly with no errors. I forgot to become root to run the VPython install script, but I ran it again as root. Actually, I ran it again with "sudo" which worked under OS 10.1.5 and Fink 0.4.1. Now, when I try to run any VPython program from IDLE, here's what I get: -----begin error message Visual-2002-07-22 Traceback (innermost last) File "/sw/share/python-visual/Programs/Demos/orbit.py", line 1, in ? from visual import * ImportError: Failure linking new module Program disconnected. -----end error message This specific example was for orbit.py, but I get the same error with any program, and I get the same error whether I run the program from the ~/VPython/Programs/Demos folder or from the duplicate folder under /sw. Any suggestions? Joe |
From: Bruce S. <bas...@un...> - 2003-01-25 04:38:58
|
Viktor Ferenczi of Hungary has contributed another lovely demo program (attached). Using recursion, he generates a cherry tree and then has the leaves flutter in a gentle breeze. Bruce Sherwood |
From: Bruce S. <bas...@un...> - 2003-01-23 02:59:16
|
Here (with attached zip file) is a very attractive clock made very quickly. Clearly, its author is highly skilled in Python, and he has used rather sophisticated coding for his example. Thanks, Viktor! (In case you're not aware of this, I should mention that Hungarian practice puts the family name first.) Bruce Sherwood ----- Original Message ----- From: "Ferenczi Viktor" <cx...@cx...> To: <bas...@un...> Sent: Wednesday, January 22, 2003 9:08 PM Subject: 3D Clock with VPython > Hi Bruce! > > I've found VPython two days ago. It's very simple and easy to use, perfect > to build prototypes very quickly. I wrote a simple reusable clock module as > my first exercise in VPython. It supports one type of analog clock, but can > be easily extended with a stopper, hour-glass or whatever you need to > display current time / duration. Here I give you the permission to include > this module in the next version/update of VPython as an example or extension > module. > > Best wishes, > Complex > |
From: <ba...@ph...> - 2003-01-22 08:18:56
|
Hi, thanks for pointing out Pmw - actually I played with this over the weekend. Basically it does what I want, _but_ it seems (please tell me that I am wrong here !!) that for each point one wants to plot a tag has to be given. In consequence, when plotting _many_ points in this way substantially increasing memory is used. Alternatively, it might be possible to just set up one vector and append the points at the end (I haven't tried this yet), but still the vector has to be kept in memory (also I would like the points to have different colors later on...). To give you an idea about what I am after I attach the current pmw version of my example (it opens with an empty window, clicking with the mouse somewhere will iterate that point 1000 times - watch with top the size of the program!). Arnd On Tue, 21 Jan 2003, Chris Burns wrote: > Hi all. > > Just thought I'd mention that the kind of graphing Arnd is looking for > is available through BLT, a widget set for Tcl/Tk. Luckily, BLT is > available through the Python Mega Widgets (Pmw). It's a bit of a pain > to setup (need to install BLT, then Pmw) and since BLT is a Tcl/Tk > add-on, it uses it's own vectors (not Numeric arrays). However, the > interface is rather nice: you make a vector and tell BLT to graph it. > Then, when you change the vector, BLT automagically updates the graph > widget (line, markers, scaling, etc). It's by no means as slick as Visual > (e.g., you need to use Tkinter to dress up the widget), but works well for > some purposes. > > See: > > Python Mega-Widgets: http://pmw.sourceforge.net/ > BLT in Python (lots of examples): http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc/ > The official BLT: http://incrtcl.sourceforge.net/blt/ > > I used it to build an interactive ODE integrator (for watching choatic > systems evolve while they are being integrated). If you're interested, have > a look: > http://pathfinder.scar.utoronto.ca/~csca57/RKFgraph.html > > Chris > > -- > Chris Burns > Visiting Assistant Professor > Dept. of physics and astronomy, Swarthmore College > cb...@sw... http://astro.swarthmore.edu/~burns > > > > |
From: Bruce S. <bas...@un...> - 2003-01-22 05:09:58
|
I was asked, "What changes when the user zooms?" Basically it is scene.mouse.camera, which gives read-only information on the current location of the "camera". For example, mag(scene.mouse.camera-scene.center) is the current distance of the camera from the spin center. In particular, scene.range is not changed during a user zoom and continues to specify the bounds for autoscaling should the scene change. Here is a little routine that shows this as you zoom or spin: from visual import * sphere() where = label(pos=(0,1.5,0)) rangeval = label(pos=(0,-1.5,0)) while 1: m = scene.mouse.camera where.text = '%0.1f, %0.1f, %0.1f' % (m.x,m.y,m.z) rangeval.text = '%0.1f, %0.1f, %0.1f' % (scene.range.x,scene.range.y,scene.range.z) There doesn't seem to be any way to set the camera position directly by program. The only thing you can do by program is set the range, which has a similar visual effect. My head hurts slightly whenever I think about this, and I might not be describing the situation quite right! Bruce |