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: Kuzminski, S. R <SKu...@fa...> - 2004-06-01 18:52:57
|
I suppose they are very different pieces of software and one of the nice things about vpython is how focused it is. I'm wishing that I could build more complex shapes, especially with Boolean shape operations, assemble them into mechanisms and have them simulated in a 'real' environment. This is probably out of the scope of vpython. =20 S =20 -----Original Message----- From: vis...@li... [mailto:vis...@li...] On Behalf Of Arthur Sent: Tuesday, June 01, 2004 10:43 AM To: vis...@li... Subject: re: [Visualpython-users] openCASCADE =20 =20 =20 _____ =20 From: Arthur [mailto:aj...@ix...]=20 Sent: Tuesday, June 01, 2004 1:42 PM To: 'Kuzminski, Stefan R'; 'vis...@li...' Subject: RE: [Visualpython-users] openCASCADE =20 From: vis...@li... [mailto:vis...@li...] On Behalf Of Kuzminski, Stefan R Sent: Tuesday, June 01, 2004 10:57 AM To: vis...@li... Subject: [Visualpython-users] openCASCADE =20 Has anyone looked into bringing the OpenCASCADE python bindings into vpython? =20 http://www.pythonizer.org/pythoncascade/pythoncascade.html =20 =20 =20 =20 To what end ? =20 Don't OpenCASCADE and VPython have very different purposes and scopes. =20 I tend to see the "smallness" and focus of VPython as one of its main strengths. =20 =20 And if one wants to work with something broad and large, what does VPython bring to OpenCascade that isn't already there? The question's intention being more than rhetorical, as I don't know anything about OpenCascade beyond what I see on the web site. =20 Art |
From: Arthur <ajs...@op...> - 2004-06-01 17:43:14
|
_____ From: Arthur [mailto:aj...@ix...] Sent: Tuesday, June 01, 2004 1:42 PM To: 'Kuzminski, Stefan R'; 'vis...@li...' Subject: RE: [Visualpython-users] openCASCADE From: vis...@li... [mailto:vis...@li...] On Behalf Of Kuzminski, Stefan R Sent: Tuesday, June 01, 2004 10:57 AM To: vis...@li... Subject: [Visualpython-users] openCASCADE Has anyone looked into bringing the OpenCASCADE python bindings into vpython? http://www.pythonizer.org/pythoncascade/pythoncascade.html To what end ? Don't OpenCASCADE and VPython have very different purposes and scopes. I tend to see the "smallness" and focus of VPython as one of its main strengths. And if one wants to work with something broad and large, what does VPython bring to OpenCascade that isn't already there? The question's intention being more than rhetorical, as I don't know anything about OpenCascade beyond what I see on the web site. Art |
From: Kuzminski, S. R <SKu...@fa...> - 2004-06-01 14:57:31
|
Has anyone looked into bringing the OpenCASCADE python bindings into vpython? =20 http://www.pythonizer.org/pythoncascade/pythoncascade.html =20 S |
From: Joel K. <jj...@ya...> - 2004-05-29 21:36:14
|
The source code that I put below the dotted line shows an unusual way of employing the "faces" object. Teachers of math and/or computer science might want to challenge their students to figure out how and why the program produces the visual output that it does. The code allows for lots of variations to experiment with in just about all of its sections. I'm afraid that the long "fa.append" line got messed up by my email system, but it should be easy to fix. Joel .............................................. from visual import * from time import * autocenter = 1 scene = display() scene.width = 1024 scene.height = 738 scene.x = 0 scene.y = 0 # Rotating 'Faces' Object fr = frame () fa = faces (frame = fr) range = 20.0 step = pi / range for nn in arange (-range, range, step): for qq in arange (-range, range, step): fa.append (pos = (cos (nn), sin (qq), sin (qq + nn)), normal = (0.99, 0.99, 0.99), green = nn / range, blue = qq / range) while 2.0 > 1.0: tt = 8000.0 / time () fr.rotate (angle = tt, axis = (step, step, step)) __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
From: Martin C. <cos...@wa...> - 2004-05-27 06:34:13
|
Jonathan Brandmeyer wrote: [] > Linux and OSX have suffered from this problem for quite a while, but I > think that I may have solved it. Please try out this patch and let me > know how it works for you. It should be applied to > cvisual/platlinux.cpp on the latest 2.1.x release. This seems to improve the situation (still for the gas.py demo): In most cases, I can now just type ESC in one of the two output windows and it exits cleanly. The problem is that this thing is not completely deterministic: In the old (unpatched) version, most of the time typing ESC in the animation window would close this window but leave the bar-graph window open and the process resistent against Ctrl-C. Even hitting the bar-graph window with xkill would only kill this window, but leave the python process running and unresponsive to Ctrl-C. It had to be killed with kill from another shell. In other cases (without recognizable pattern), upon hitting ESC in the animation window, it would empty that window but not close it and leave both windows unresponsive to attempts to close them. In this case, hitting Ctrl-C 3 times in the console window would kill the process and the windows. With the new (patched) version, most of the time, hitting ESC in one of two output windows closes both and exits the process. Sometimes, it left the windows empty but open and unclosable. But then Ctrl-C worked every time. In any case, the patch is now included in the updated Fink package. -- Martin |
From: Jonathan B. <jbr...@ea...> - 2004-05-26 12:03:42
|
On Wed, 2004-05-26 at 03:25, Martin Costabel wrote: > Aaron Titus wrote: > > > That was very simple! Thank you! > > > > I still have a problem with the demo program, gas.py. I cannot close the > > program. I suspect that I'll have the same problem with any program that > > instantiates a graph. > > I confirm, I have the same problem. No idea where the bug is. Linux and OSX have suffered from this problem for quite a while, but I think that I may have solved it. Please try out this patch and let me know how it works for you. It should be applied to cvisual/platlinux.cpp on the latest 2.1.x release. Thanks, Jonathan Brandmeyer |
From: Martin C. <cos...@wa...> - 2004-05-26 07:25:21
|
Aaron Titus wrote: > That was very simple! Thank you! > > I still have a problem with the demo program, gas.py. I cannot close the > program. I suspect that I'll have the same problem with any program that > instantiates a graph. I confirm, I have the same problem. No idea where the bug is. -- Martin |
From: Aaron T. <ti...@ma...> - 2004-05-26 01:03:44
|
That was very simple! Thank you! I still have a problem with the demo program, gas.py. I cannot close the program. I suspect that I'll have the same problem with any program that instantiates a graph. AT On May 25, 2004, at 5:22 PM, Martin Costabel wrote: > If you install visual-py23 from Fink, you don't need Python-2.2. Here > are the *complete* instructions to install VPython with Fink: > > 1. Install Fink > > 2. Tell Fink to install visual-py23, either from binary or from > source. Read the Fink documentation how to do this, but it does not > take more than either a mouse click in FinkCommander or typing "fink > install visual-py23" in a Terminal window. > > This is all, everything else is taken care of automatically. > > -- > Martin > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Martin C. <cos...@wa...> - 2004-05-25 21:22:57
|
Aaron Titus wrote: > ok, I did a clean install of Mac OS 10.3 (Panther). > > I installed Fink and the necessary programs, including both Python 2.2 > and Python 2.3. > > I installed VPython according to the instructions at vpython.org. [] > (3) Why must we use Python 2.2? I thought that we could use Python 2.3, > but expanding the tarball only installs visual in the Python 2.2 folder. If you install visual-py23 from Fink, you don't need Python-2.2. Here are the *complete* instructions to install VPython with Fink: 1. Install Fink 2. Tell Fink to install visual-py23, either from binary or from source. Read the Fink documentation how to do this, but it does not take more than either a mouse click in FinkCommander or typing "fink install visual-py23" in a Terminal window. This is all, everything else is taken care of automatically. -- Martin |
From: Aaron T. <ti...@ma...> - 2004-05-25 19:35:00
|
ok, I did a clean install of Mac OS 10.3 (Panther). I installed Fink and the necessary programs, including both Python 2.2 and Python 2.3. I installed VPython according to the instructions at vpython.org. Here are my issues: (1) My PATH does not include /sw/bin when running X11. Evidently I need a .xinitrc file that sets the PATH. Any suggestions? Creating a new .xinitrc file crippled X11. (2) In 10.2 (Jaguar), I had a problem running a vpython script that opened a graph in a separate window. I always had to kill the process in order to exit. I thought that this was fixed in the latest vpython; however, when I ran the gas.py demo, I had the same problem trying to close the windows. Finally, it generated this error: Xlib: extension "Apple-DRI" missing on display ":0.0". Xlib: extension "Apple-DRI" missing on display ":0.0". and I had to once again kill the process. (3) Why must we use Python 2.2? I thought that we could use Python 2.3, but expanding the tarball only installs visual in the Python 2.2 folder. Thanks for the help, Aaron |
From: Lee H. <mi...@ho...> - 2004-05-21 21:27:37
|
Just a quick note that with the lastest gcc 3.3 upgrade in FreeBSD ports (3.3.4 20040505) I am now able to build visual-2.9.3 and run many of the examples. bounce.py bounce2.py colorsliders.py controlstest.py crystal_old.py dipole.py doublependulum.py hanoi.py In the examples which work, the mouse buttons work just fine also. Most of the examples die with : Abort (core dumped) convex.py crossproduct.py crystal.py (but not crystal_old.py) drape.py faces_cone.py faces_heightfield.py gas.py graphtest.py gyro2.py helix.py lathe.py lorenz.py orbit.py planar.py randombox.py stars.py stonehenge.py text.py texttest.py tictac.py toroid.py toroid_drag.py wave.py crossproduct.py gives ... Segmentation fault (core dumped) gyro.py finishes with ... Traceback (most recent call last): File "gyro.py", line 49, in ? radius=Rspring, thickness=Dspring, color=(1,0.7,0.2)) File "/usr/local/lib/python2.3/site-packages/visual/primitives.py", line 190, in __init__ pos_data[:,0] = xx TypeError: Array can not be safely cast to required type dipole.py works, but hangs when trying to close the window. I am not sure what is common between the ones which work, but I suspect some module which is built with the wrong compiler (numeric? Would that cause a failure like this?) Maybe I will try rebuilding numeric with gcc33 and see what happens. Thanks for your time. _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail |
From: Aaron T. <ti...@ma...> - 2004-05-20 13:55:35
|
I just upgraded to Panther. I DID NOT do a clean install. However, I'm considering doing it again, but doing a clean install. For getting a pristine installation of Fink and the latest Python/VPython, what do the Mac users on this list suggest? Thanks, Aaron |
From: Jonathan B. <jbr...@ea...> - 2004-05-18 02:06:05
|
On Mon, 2004-05-17 at 11:26, Zbigniew wrote: > Windows question: > how to get rid of that black useless window > behind visual display (also Tkinter). > I know py2exe can generate non dos exe, > but how to achieve that on script level? > > regards > Try using the pythonw.exe executable rather than python.exe. HTH, Jonathan Brandmeyer |
From: Zbigniew <ze...@in...> - 2004-05-17 16:02:11
|
> almost anything. This includes dealing with sound. In fact, I think the > creator of Python, Guido van Rossum, himself contributed to the sound > capabilities. I haven't used this machinery myself, though. > In the Python documentation, see section 14 (multimedia) of the "Library > Reference" document. yes. there is somekind of support for OSS but this is system specific feature :( I will look if something external exists. when I am on subject of system specials: label object can have font specified. Names like Arial or Helvetica are system specific. Support for names known from CSS -- monospace, serif, sans-serif would be interesting feature. Windows question: how to get rid of that black useless window behind visual display (also Tkinter). I know py2exe can generate non dos exe, but how to achieve that on script level? regards Zbigniew Trzcionkowski <ze...@in...> |
From: Bruce S. <Bru...@nc...> - 2004-05-16 20:57:36
|
I think the question below wasn't addressed by anyone, so I'll give it a shot. There is an extremely extensive set of modules for Python, to do almost anything. This includes dealing with sound. In fact, I think the creator of Python, Guido van Rossum, himself contributed to the sound capabilities. I haven't used this machinery myself, though. In the Python documentation, see section 14 (multimedia) of the "Library Reference" document. Bruce Sherwood Zbigniew wrote: > Other questions: > 1. Is there chance for sound module for python? |
From: Jonathan B. <jbr...@ea...> - 2004-05-16 20:21:05
|
On Sat, 2004-05-15 at 23:37, Andrew Williams wrote: > On Sat, 15 May 2004 21:36:07 -0400, Bruce Sherwood wrote: > > >I don't understand this syntax. If pos2 and pos1 are intended to stand > >for something like box1.pos and box2.pos, positions of VPython objects, > >then what you need is mag(pos2-pos1), not abs(pos2-pos1). > > > >> On Fri, 2004-05-14 at 09:28, Andrew Williams wrote: > >>> > >>>if abs(pos2 - pos1) < 0.01: > >>> handle_collision() > > The 'abs' builtin does return the magnitude of a vector - I checked > before posting the email. This is undocumented behavior and should not be relied upon in the future. -Jonathan Brandmeyer |
From: Andrew W. <an...@ph...> - 2004-05-16 03:37:24
|
On Sat, 15 May 2004 21:36:07 -0400, Bruce Sherwood wrote: >I don't understand this syntax. If pos2 and pos1 are intended to stand >for something like box1.pos and box2.pos, positions of VPython objects, >then what you need is mag(pos2-pos1), not abs(pos2-pos1). > >> On Fri, 2004-05-14 at 09:28, Andrew Williams wrote: >>> >>>if abs(pos2 - pos1) < 0.01: >>> handle_collision() The 'abs' builtin does return the magnitude of a vector - I checked before posting the email. It doesn't work for tuples, only visual's vector types. I'd actually forgotten about the 'mag' function, but I assume that _would_ work for tuples, as it'd auto-convert them into vectors like all the other visual functions. Andrew |
From: Bruce S. <Bru...@nc...> - 2004-05-16 01:36:02
|
I don't understand this syntax. If pos2 and pos1 are intended to stand for something like box1.pos and box2.pos, positions of VPython objects, then what you need is mag(pos2-pos1), not abs(pos2-pos1). Bruce Sherwood Jonathan Brandmeyer wrote: > On Fri, 2004-05-14 at 09:28, Andrew Williams wrote: > >>On Fri, 14 May 2004 08:53:45 -0400, Jonathan Brandmeyer wrote: >> >> >>>All vectors are always floating-point values in VPython. If you need to >>>truncate the precision to an integer type, you will probably need to >>>write your own round-to-nearest conversion routine since Python only >>>directly supports truncation of the decimal part. See math.modf() for >>>some help here. >> >>I'd have thought the 'round' builtin would do just that. It returns a >>float, but rounded to the specified number of decimal places (if the >>optional number of decimal places is omitted), so int(round(x)) should >>always be the nearest integer. >> >>Still, I'd test for collision by specifying a tolerance a bit more >>explicitly - if pos2 and pos1 are both vectors, this is short and very >>readable: >> >>if abs(pos2 - pos1) < 0.01: >> handle_collision() >> >>Andrew > > > > Of course, a built-in function. I was only looking in the math module. > Thanks for clearing this up. > > -Jonathan Brandmeyer > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Jonathan B. <jbr...@ea...> - 2004-05-15 03:03:32
|
On Fri, 2004-05-14 at 09:28, Andrew Williams wrote: > On Fri, 14 May 2004 08:53:45 -0400, Jonathan Brandmeyer wrote: > > >All vectors are always floating-point values in VPython. If you need to > >truncate the precision to an integer type, you will probably need to > >write your own round-to-nearest conversion routine since Python only > >directly supports truncation of the decimal part. See math.modf() for > >some help here. > > I'd have thought the 'round' builtin would do just that. It returns a > float, but rounded to the specified number of decimal places (if the > optional number of decimal places is omitted), so int(round(x)) should > always be the nearest integer. > > Still, I'd test for collision by specifying a tolerance a bit more > explicitly - if pos2 and pos1 are both vectors, this is short and very > readable: > > if abs(pos2 - pos1) < 0.01: > handle_collision() > > Andrew Of course, a built-in function. I was only looking in the math module. Thanks for clearing this up. -Jonathan Brandmeyer |
From: Andy D. <dou...@la...> - 2004-05-14 20:57:58
|
On Fri, 14 May 2004, Bruce Sherwood wrote: > There was a comment that the Matrix module isn't normally installed on > machines running VPython. I don't think that's quite right. It is a > component of Numeric and normally installs with it. Without doing > anything special, it seems to be present on both my Windows and Linux > machines. Maybe if you do something special when installing Numeric you > can exclude it? On a Debian system, Matrix.py is in a separate package such as python2.3-numeric-ext that needs to be installed. (I don't know why offhand; it probably has to do with handling underlying library dependencies.) It is not installed by default, and Visual normally works fine without it, so I hadn't noticed it was missing. -- Andy Dougherty dou...@la... Dept. of Physics Lafayette College, Easton PA 18042 |
From: Bruce S. <Bru...@nc...> - 2004-05-14 20:30:59
|
There was a comment that the Matrix module isn't normally installed on machines running VPython. I don't think that's quite right. It is a component of Numeric and normally installs with it. Without doing anything special, it seems to be present on both my Windows and Linux machines. Maybe if you do something special when installing Numeric you can exclude it? Bruce Sherwood |
From: Zbigniew <ze...@in...> - 2004-05-14 18:36:55
|
> optional number of decimal places is omitted), so int(round(x)) should > always be the nearest integer. that's it! I didn't notice how exactly int() function does work. Thank you all for the effort and please forgive me the problems I had with describing the problem I had. >if abs(pos2 - pos1) < 0.01: > handle_collision() thats also very good The fixed game should be there: http://zeeball.w.interia.pl/bin/snake3d.tar.bz2 I have added in comments short description of the game. Let me know if anyone managed to play that game with or without this description: # there is 3D space with green box and flashing box # the green box is the food for the snake # and the flashing box is head of the snake # the snake is always moving in in Z direction # therefore to navigate the snake we have to rotate # the whole space with arrow keys till the snake # collides with food Once again big thanks! Zbigniew Trzcionkowski <ze...@in...> |
From: Zbigniew <ze...@in...> - 2004-05-14 18:36:52
|
> All vectors are always floating-point values in VPython. If you need to > truncate the precision to an integer type, you will probably need to > write your own round-to-nearest conversion routine since Python only > directly supports truncation of the decimal part. See math.modf() for > some help here. Yes! That was the reason. I even don't need the Matrix module now. I can give it as example for Vpython. Let me know what to change in the "shape" of the code. > VPython doesn't support anything in screen coordinates except for > portions of the text object. I'm doing some experiments with OpenGL > textures that may yield fruit in this area, but its way too early to > tell right now. Nice to know. Zbigniew Trzcionkowski <ze...@in...> |
From: Andrew W. <an...@ph...> - 2004-05-14 13:28:20
|
On Fri, 14 May 2004 08:53:45 -0400, Jonathan Brandmeyer wrote: >All vectors are always floating-point values in VPython. If you need to >truncate the precision to an integer type, you will probably need to >write your own round-to-nearest conversion routine since Python only >directly supports truncation of the decimal part. See math.modf() for >some help here. I'd have thought the 'round' builtin would do just that. It returns a float, but rounded to the specified number of decimal places (if the optional number of decimal places is omitted), so int(round(x)) should always be the nearest integer. Still, I'd test for collision by specifying a tolerance a bit more explicitly - if pos2 and pos1 are both vectors, this is short and very readable: if abs(pos2 - pos1) < 0.01: handle_collision() Andrew |
From: Jonathan B. <jbr...@ea...> - 2004-05-14 12:53:48
|
On Fri, 2004-05-14 at 06:04, Zbigniew wrote: caveat, I haven't looked at any of your code. > 3. > The collision detection is done with > the pos field. The rotations of the > playfield are 90 degree (split in > phases to animate). > Pos coordinates of the boxes are used > to detect collisions and should be > integer numbers > (I assumed that 90 degree rotations transform > integer into integer). This is probably not a valid assumption if you are using the built-in rotate() function. > I'm aware of the floats during roations therefore > I do float->int conversion. > I do it but sometimes the snake runs through > the green box and collision is not detected. > Code looks ok. Thats the major problem > I cannot solve and I came here with. All vectors are always floating-point values in VPython. If you need to truncate the precision to an integer type, you will probably need to write your own round-to-nearest conversion routine since Python only directly supports truncation of the decimal part. See math.modf() for some help here. > 2. Is there chance for bitmap graphics support > (I imagine it as a layer on the top of the 3d display). > That would be also useful for teaching of the computer > graphics (drawing lines, filtering images etc.) VPython doesn't support anything in screen coordinates except for portions of the text object. I'm doing some experiments with OpenGL textures that may yield fruit in this area, but its way too early to tell right now. HTH, Jonathan Brandmeyer |