MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fast interactive graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78024] Re: Fast interactive graphics
  • From: Helen Read <read at math.uvm.edu>
  • Date: Thu, 21 Jun 2007 05:53:18 -0400 (EDT)
  • References: <f58d3p$8cl$1@smc.vnet.net> <f5at1i$adm$1@smc.vnet.net>

Helen Read wrote:
> 
> The one graphic that's been causing the most trouble is the following.
> The idea is to illustrate the use of washers (stacked on top of each 
> other) to approximate the volume of a solid of revolution. For example:
> 
> f[y_]=1/12(18-y+9y^2-3y^4);
> g[y_]=1-y/12-(y^2)/8;
> RevolutionPlot3D[{{f[y], y}, {g[y], y}}, {y, -2, 2}]
> 
> Because of the "hole" in the middle of each washer, I was unable to come 
> up with a way to do what I needed with Cylinder[]. (I tried concentric 
> cylinders, with the idea of having the inner cylinder acting as negative 
> space -- the hole -- but after much fiddling around with Opacity, Color, 
> etc., I couldn't find a way to make it look right.) So here's what I 
> have instead.
> 
> n=10;
> dy=4/n;
> Show[Table[RegionPlot3D[g[-2+(k+1/2)dy]^2 <= x^2+y^2 <= 
> f[-2+(k+1/2)dy]^2,{x,-3,3},{y,-3,3},{z,-2+k*dy,-2+(k+1)dy}, 
> PlotPoints->25,Mesh->False],PlotRange->Automatic]

Let's try that again. This is what I meant:

n=10;
dy=4/n;
Show[Table[RegionPlot3D[g[-2+(k+1/2)dy]^2 <= x^2+y^2 <=
f[-2+(k+1/2)dy]^2,{x,-3,3},{y,-3,3},{z,-2+k*dy,-2+(k+1)dy},
PlotPoints->25,Mesh->False],{k,0,n-1}],PlotRange->Automatic]

> Until I tried setting Mesh->False, this thing would freeze up my PC 
> completely if I tried to rotate it with the mouse. With Mesh->False it's 
> a lot better -- it's still a bit sluggish, but it will rotate with the 
> mouse as long as n (and the number of PlotPoints) isn't too large. I 
> think it will be fine on the newer computers in the classroom, but if 
> you can think of a way to make it a little less sluggish and still look 
> OK, let me know.


  • Prev by Date: Re: Simple ODE with time-dep BC
  • Next by Date: Re: copying values of entries between matrices
  • Previous by thread: Re: Fast interactive graphics
  • Next by thread: Re: Re: Fast interactive graphics