From: symion <sy...@pr...> - 2009-01-12 11:07:28
|
The following program generates a Microsoft Visual C++ Assertion error message! It has something to do with a box in a frame and changing opacity! Symion from __future__ import division from visual import * from random import uniform,random # Derek Harrison, The Knoware Archive, December 2008 def wireframe(w,h,d): # For point, curve and convex Object position. x=w/2.0 y=h/2.0 z=d/2.0 mat=[(-x,-y,-z),(x,-y,-z),(x,y,-z),(-x,y,-z), (-x,-y,-z),(-x,-y,z),(x,-y,z),(x,y,z), (-x,y,z),(-x,-y,z),(x,-y,z),(x,-y,-z), (x,y,-z),(x,y,z),(-x,y,z),(-x,y,-z)] return mat def start(): scene.visible=0 scene.range=4.0 scene.fov=1.103 scene.ambient=0.5 scene.userzoom=1 scene.userspin=1 scene.x=0 scene.y=0 scene.width=600 scene.height=400 scene.title='Project : Symion 2008' scene.forward=vector(0.622, 0.638, -0.455) start() # old=False f1=frame(pos=(0,0,0)) f2=frame(pos=(0,0,0)) f3=frame(pos=(0,0,0)) f4=frame(pos=(0,0,0)) # if old: curve(frame=f1,pos=wireframe(1/4,4,4),color=color.orange) convex(frame=f1,pos=wireframe(1/4,4,4),color=color.red) curve(frame=f2,pos=wireframe(1/3,3,3),color=color.yellow) convex(frame=f2,pos=wireframe(1/3,3,3),color=color.orange) curve(frame=f3,pos=wireframe(1/2,2,2),color=color.white) convex(frame=f3,pos=wireframe(1/2,2,2),color=color.yellow) curve(frame=f4,pos=wireframe(1,1,1),color=color.blue) convex(frame=f4,pos=wireframe(1,1,1),color=color.white) else: box(frame=f1,size=(1/4,4,4),color=color.orange) box(frame=f2,size=(1/3,3,3),color=color.yellow) box(frame=f3,size=(1/2,2,2),color=color.white) box(frame=f4,size=(1,1,1),color=color.blue) scene.visible=1 a=radians(1**2) b=radians(2**2) c=radians(3**2) d=radians(4**2) while 1: rate(10) f1.rotate(angle=a) f2.rotate(angle=b) f3.rotate(angle=c) f4.rotate(angle=d) if scene.mouse.events>0: m=scene.mouse.getevent() if m.release=='left': if m.pick: if m.pick.__class__ is box: scene.center=m.pick.pos m.pick.opacity=random() else: scene.center=m.pickpos m.pick.color=(random(),random(),random()) else: scene.center=scene.mouse.pos else: pass else: pass |
From: Bruce S. <Bru...@nc...> - 2009-01-12 17:07:45
|
Thanks for the report. Here's the nub of the problem: The following crashes hard, at least on Vista: f = frame() b = box(frame=f) b.opacity=0.3 But the following doesn't crash: f = frame() b = box(frame=f, opacity=0.5) b.opacity=0.3 I have no idea what causes this. Bruce Sherwood symion wrote: > The following program generates a Microsoft Visual C++ Assertion error > message! > It has something to do with a box in a frame and changing opacity! > > Symion > |
From: Scott D. D. <Sco...@Ac...> - 2009-01-12 18:31:35
|
Bruce Sherwood wrote: > .... Here's the nub of the problem: > The following crashes hard, at least on Vista (and on XP): > f = frame() > b = box(frame=f) > b.opacity=0.3 > The following doesn't crash: > f = frame() > b = box(frame=f, opacity=0.5) > b.opacity=0.3 Checking a bit further, the following crashes: > f = frame() > p = sphere(frame=f, opacity=1) > p.opacity = 0.99 > The following doesn't crash: > f = frame() > p = sphere(frame=f, opacity=0.99) > p.opacity = 1 > p.opacity = .3 > p.opacity = 0 So, a work-around is to create things you expect to tweak opacity on as .99 opacity. This doesn't get to the root cause, but does let you move on. --Scott David Daniels Sco...@Ac... |
From: Bruce S. <Bru...@nc...> - 2009-01-12 19:44:30
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Thanks, Scott! Your observation should be a good big hint at where the problem lies, though I don't yet see where this leads.<br> <br> Bruce Sherwood<br> <br> Scott David Daniels wrote: <blockquote cite="mid:gkg29d$dlo$1...@ge..." type="cite"> <pre wrap="">Bruce Sherwood wrote: </pre> <blockquote type="cite"> <pre wrap="">.... Here's the nub of the problem: The following crashes hard, at least on Vista (and on XP): f = frame() b = box(frame=f) b.opacity=0.3 The following doesn't crash: f = frame() b = box(frame=f, opacity=0.5) b.opacity=0.3 </pre> </blockquote> <pre wrap=""><!----> Checking a bit further, the following crashes: > f = frame() > p = sphere(frame=f, opacity=1) > p.opacity = 0.99 > The following doesn't crash: > f = frame() > p = sphere(frame=f, opacity=0.99) > p.opacity = 1 > p.opacity = .3 > p.opacity = 0 So, a work-around is to create things you expect to tweak opacity on as .99 opacity. This doesn't get to the root cause, but does let you move on. --Scott David Daniels <a class="moz-txt-link-abbreviated" href="mailto:Sco...@Ac...">Sco...@Ac...</a> ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/sf-spreadtheword">http://p.sf.net/sfu/sf-spreadtheword</a> _______________________________________________ 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> |
From: Lenore H. <lh...@si...> - 2009-01-13 00:34:51
|
Very naively,... This looks to me like the need is to create things with some opacity (it doesn't maybe matter what since both 0.5 and 0.99 work). Does this mean there is no default value for opacity and somewhere a number, any number, is needed to figure out what to put on the screen and all for the want of a number the program crashes? Lenore On Jan 12, 2009, at 13:44 PM, Bruce Sherwood wrote: > Thanks, Scott! Your observation should be a good big hint at where > the problem lies, though I don't yet see where this leads. > > Bruce Sherwood > > Scott David Daniels wrote: >> >> Bruce Sherwood wrote: >> >>> .... Here's the nub of the problem: >>> The following crashes hard, at least on Vista (and on XP): >>> f = frame() >>> b = box(frame=f) >>> b.opacity=0.3 >>> The following doesn't crash: >>> f = frame() >>> b = box(frame=f, opacity=0.5) >>> b.opacity=0.3 >>> >> Checking a bit further, the following crashes: >> > f = frame() >> > p = sphere(frame=f, opacity=1) >> > p.opacity = 0.99 >> > The following doesn't crash: >> > f = frame() >> > p = sphere(frame=f, opacity=0.99) >> > p.opacity = 1 >> > p.opacity = .3 >> > p.opacity = 0 >> >> So, a work-around is to create things you expect to tweak opacity >> on as .99 opacity. This doesn't get to the root cause, but does let >> you move on. >> >> --Scott David Daniels >> Sco...@Ac... >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users >> > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword_______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Bruce S. <Bru...@nc...> - 2009-01-13 00:48:24
|
Don't I wish it were that simple. No, objects are created with opacity=1.0 by default. That's why a scene contains opaque objects if you don't explicitly set the opacity to something different. b = box() print b.opacity # shows 1.0 Bruce Sherwood Lenore Horner wrote: > Very naively,... > > This looks to me like the need is to create things with some opacity (it > doesn't maybe matter what since both 0.5 and 0.99 work). Does this mean > there is no default value for opacity and somewhere a number, any > number, is needed to figure out what to put on the screen and all for > the want of a number the program crashes? > > Lenore > > On Jan 12, 2009, at 13:44 PM, Bruce Sherwood wrote: > >> Thanks, Scott! Your observation should be a good big hint at where the >> problem lies, though I don't yet see where this leads. >> >> Bruce Sherwood >> >> Scott David Daniels wrote: >>> Bruce Sherwood wrote: >>> >>>> .... Here's the nub of the problem: >>>> The following crashes hard, at least on Vista (and on XP): >>>> f = frame() >>>> b = box(frame=f) >>>> b.opacity=0.3 >>>> The following doesn't crash: >>>> f = frame() >>>> b = box(frame=f, opacity=0.5) >>>> b.opacity=0.3 >>>> >>> Checking a bit further, the following crashes: >>> > f = frame() >>> > p = sphere(frame=f, opacity=1) >>> > p.opacity = 0.99 >>> > The following doesn't crash: >>> > f = frame() >>> > p = sphere(frame=f, opacity=0.99) >>> > p.opacity = 1 >>> > p.opacity = .3 >>> > p.opacity = 0 >>> >>> So, a work-around is to create things you expect to tweak opacity >>> on as .99 opacity. This doesn't get to the root cause, but does let >>> you move on. >>> >>> --Scott David Daniels >>> Sco...@Ac... >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by: >>> SourcForge Community >>> SourceForge wants to tell your story. >>> http://p.sf.net/sfu/sf-spreadtheword >>> _______________________________________________ >>> Visualpython-users mailing list >>> Vis...@li... >>> https://lists.sourceforge.net/lists/listinfo/visualpython-users >>> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword_______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > > > ------------------------------------------------------------------------ > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |