Re: Why are my 3D plots blue?

*To*: mathgroup at smc.vnet.net*Subject*: [mg114321] Re: Why are my 3D plots blue?*From*: Joseph Gwinn <joegwinn at comcast.net>*Date*: Wed, 1 Dec 2010 02:10:11 -0500 (EST)*References*: <id2eko$d5t$1@smc.vnet.net>

In article <id2eko$d5t$1 at smc.vnet.net>, John Fultz <jfultz at wolfram.com> wrote: > On Mon, 29 Nov 2010 06:07:39 -0500 (EST), Joseph Gwinn wrote: > > In article <ictfvj$mi6$1 at smc.vnet.net>, John Fultz <jfultz at wolfram.com> > > wrote: > > > >> If you can move the Dynamic inside of the Graphics3D[], you'll have a > >> much > >> better experience. I.e., instead of... > >> > >> Dynamic[stuff; Graphics3D[{dirs}, opts]] > >> > >> do this... > >> > >> Graphics3D[Dynamic[stuff; {dirs}], opts] > >> > > I will try this. > > > > Will something like: > > > > DynamicModule[{local variables}, > > Dynamic[stuff]; > > Graphics3D[ Dynamic[graphic directives], opts] > > ] > > > > also work? I've tried some similar approaches, but the graphics didn't > > respond to mouse motion, don't know exactly why. I would have thought > > that a local variable x would be linked by the Dynamic functions. I > > assume I didn't quite do it right. > > No, that won't work. To understand why, read through my post here... > > http://forums.wolfram.com/mathgroup/archive/2009/Feb/msg00424.html > > For a further library of stuff that I've written about Dynamic, see here... > > http://forums.wolfram.com/mathgroup/archive/2010/May/msg00440.html Thanks. I'll study these. I've read all the relevant documentation, and still don't really have a complete grasp of Dynamic and its friends. > >> and if the options should be dynamically updated, put individual > >> Dynamics in the option values. > >> > > Will this allow me to track the current value of for instance > > ViewMatrix? I have tried Dynamic[ViewMatrix] to no effect, getting an > > unchanging empty list {} in response. > > Alas, there's a bug here. You're the first to uncover this, it appears. > I've made a report to the appropriate developers. Ahh. Thanks. I would guess that you were already able to reproduce the problem, but here are some miscreants I tried: Graphics3D[{Text[Options[Dynamic[ViewMatrix]],{0,0,0}],Text[Options[Dynam ic[ViewPoint]],{0,0,1}]},ViewPoint->{Pi,Pi/2,2},SphericalRegion->True] Graphics3D[{Text[Dynamic[Options[ViewMatrix]],{0,0,0}],Text[Options[ViewP oint],{0,0,1}]},ViewPoint->{Pi,Pi/2,2},SphericalRegion->True] Dynamic[Graphics3D[{Text[Options[ViewMatrix],{0,0,0}],Text[Options[ViewPo int],{0,0,1}]},ViewPoint->{Pi,Pi/2,2},SphericalRegion->True]] > >> The basic problem here is that the Graphics3D is being recreated over > >> and over again and Mathematica is getting confused about what exactly > >> should be selected. In typical examples, this kind of thing works fine, > >> but your code, for reasons I haven't investigated, stresses this enough > >> to expose the problem. By preventing the Graphics3D wrapper from being > >> recreated, you can avoid the problem entirely. > >> > > OK. Sounds like it will be faster too. > > Yes, but probably only marginally so. One thing I have been doing is to generate 3D plots in two pieces, with the unchanging background done once (with no Dynamic calls), the changing stuff generated in another Graphics3D, then using Show to merge things. The pattern is something like: staticplot=Graphics3d[<background scenery>]; (* No Dynamic stuff *) DynamicModule[{local vars}, dynamicplot=Graphics3D[Dynamic[<stuff that moves>]]; Show[staticplot,dynamicplot] ] Comments? It this complication worthwhile? > > Another perhaps related effect discovered by accident is that moving the > > 3D mouse while Mathematica is doing the initial evaluation of the > > notebook can cause Mathematica to crash with a SEGFAULT error. This > > happened a few days ago, and I allowed MacOS to send the crash report to > > Apple. > > This might require further investigation of the specific notebook you're > working with. I suggest starting a dialog with technical support about this. OK. If I can reproduce the problem. I assume that Tech Support can access Mathematica crash logs sent to Apple. I bet the logs are under a rock somewhere on my machine somewhere as well. Regards, Joe Gwinn