From: symion <sy...@pr...> - 2008-12-26 04:23:10
|
I have been testing Vpython, looking for boundaries. IDLE just through up an error. I was zooming in to a simple scene, looking for limits Zooming in to destruction. Here is the code snippet that was running, although I have run other bits of code and found the same result. r=1.49e+15 cur=[(0,0,0),(r,0,0)] p=points(pos=cur,color=(1,1,1)) Now zoom in and in, and in like a crazy man, looking for that boundary. oops! VPython ***CRITICAL ERROR***: ..\src\core\display_kernel.cpp:909: cvisual::display_kernel::render_scene: OpenGL error: ..\src\core\display_kernel.cpp:548 invalid value, aborting. Also, when zooming out and out... VPython ***CRITICAL ERROR***: ..\src\core\display_kernel.cpp:535: cvisual::display_kernel::world_to_view_transform: VPython degenerate projection: 1.#INF 1.#INF 0.0500417 0.0315297 Yep, found the other one! Are the problems reported related to the apparent lack of any clear range/scale boundaries? Which leads me into the next question. I am having problems with scene.range. I expect it to be connected to user zoom, so I can measure user input, just like scene.forward method. This is what I have found. If I run any program without setting scene.range then a default value seems to be used and the program runs OK, but if I then try to read the current scene.range, IDLE displays the following warning. Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> scene.range RuntimeError: Reading .scale and .range is not supported when autoscale is enabled. Now if I change the program so that scene.range is set to some arbitrary value and then run it, then the program runs OK, no problems, and reading scene.range returns the exact value I gave it! (which is kind of redundant) But when as a user I zoom in or out, and then read scene.range, nothing happens! the value is as I had previously set, no user actions are recorded by scene.range! if scene.userzoom and scene.range are not connected, then how can I (or my program) determine the current user zoom value? Symion |
From: Bruce S. <Bru...@nc...> - 2008-12-26 16:41:08
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Thanks for the report. We need to check for the zoom distance being too large or too small to represent with floating-point numbers. For instance, zooming in and in and in there is a crash when the camera distance is about 1e-330, similar issue in zooming way out. But as you saw, you have to work very hard to get to these limits!<br> <br> The range/distance issue is a long-standing problem. One way of characterizing it is that user zoom involves an internal scale factor that's not visible to the program. I think that the only significant change from Visual 3 is to give an error on trying to read the range in the autoscale condition, where it is either meaningless or misleading. I'm hopeful in 5.x that we'll come up with a better scheme. In the meantime, it would be useful to have simple examples of situations that you can't manage adequately in the current scheme.<br> <br> The range has never changed when you zoom. That too is like Visual 3.<br> <br> Bruce Sherwood<br> <br> symion wrote: <blockquote cite="mid:495...@pr..." type="cite"><font size="-1"><font face="Helvetica, Arial, sans-serif">I have been testing Vpython</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">, looking for boundaries.</font></font><br> <br> <font size="-1"><font face="Helvetica, Arial, sans-serif">IDLE just through up an error.<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> I was zooming in to a simple scene, looking for limits<br> Zooming in </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">to destruction.<br> <br> </font></font><small>Here is the code snippet that was running, although I have run other bits of code and found the same result.<br> <br> </small><font size="-1"><font face="Helvetica, Arial, sans-serif">r=1.49e+15<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">cur=[(0,0,0),(r,0,0)]</font></font><br> <font size="-1"><font face="Helvetica, Arial, sans-serif">p=points(pos=cur,color=(1,1,1))<br> <br> Now zoom in</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"> and in, and in</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"> like a crazy man</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">, looking for that boundary.</font></font><br> <br> <font size="-1"><font face="Helvetica, Arial, sans-serif">oops!<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> VPython ***CRITICAL ERROR***: ..\src\core\display_kernel.cpp:909: cvisual::display_kernel::render_scene: OpenGL error: ..\src\core\display_kernel.cpp:548 invalid value, aborting.<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> Also, w</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">hen zooming out and out...</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> <br> VPython ***CRITICAL ERROR***: ..\src\core\display_kernel.cpp:535: cvisual::display_kernel::world_to_view_transform: VPython degenerate projection: 1.#INF 1.#INF 0.0500417 0.0315297<br> <br> Yep, found the other one!<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> Are the problems reported related to the apparent lack of any clear range/scale boundaries?<br> <br> Which leads me into the next question.<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> I am having problems with scene.range. I expect it to be connected to user zoom, so I can measure user input, just like scene.forward method.<br> <br> This is what I have found.<br> If I run any program without setting scene.range then a default value seems to be used and the program runs OK, but if I then try to read the current scene.range, IDLE displays the following warning.<br> <br> Traceback (most recent call last):<br> File "<pyshell#1>", line 1, in <module><br> scene.range<br> RuntimeError: Reading .scale and .range is not supported when autoscale is enabled.<br> <br> Now if I change the program so that scene.range is set to some arbitrary value and then run it, then the program runs OK, no problems, and reading scene.range returns the exact value I gave it! (which is kind of redundant) <br> <br> But when as a user I zoom in or out, and then read scene.range, nothing happens! the value is as I had previously set, no user actions are recorded by scene.range!<br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">if scene.userzoom and scene.range are not connected</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">, then how can I (or my program) determine the current user zoom value?<br> <br> </font></font><font size="-1"><font face="Helvetica, Arial, sans-serif">Symion</font></font><font size="-1"><font face="Helvetica, Arial, sans-serif"><br> </font></font> <br> <pre wrap=""> <hr size="4" width="90%"> ------------------------------------------------------------------------------ </pre> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> </pre> </blockquote> </body> </html> |