CubeMathematica Examples

CubeMathematica currently supports all 3D surface display functions.  Evaluate the following to see how they work or investigate their examples :

?Plot3D
(*  click here for example *)

?ListContourPlot3D
(*  click here for example *)

?ParametricPlot3D
(*  click here for example *)

?RegionPlot3D
(*  click here for example *)

?SphericalPlot3D
(*  click here for example *)

Following are some surfaces that can be displayed in the Cube.  Make sure you set up the CubeMathematica framework before evaluating them:

■     ArcSine function displayed with Plot3D

Manipulate[Plot3D[a*Sin[x*y],{x,-2,2},{y,-2,2},Mesh->None,PlotStyle->Directive[Yellow,Specularity[White,20],Opacity[0.8]],ExclusionsStyle->{None,Red},DisplayFunction:>((RenderSZG[#];#)&)],{a,1,5}]

■     \ displayed with ListContourPlot3D

ListContourPlot3D[Table[x^2+y^2+z^2,{x,-2,2,0.2},{y,-2,2,0.2},{z,-2,2,0.2}],Contours->6,Mesh->None,DisplayFunction:>((RenderSZG[#];#)&)]

■     Cable Knot displayed with ParametricPlot3D

turn=9; ext=2; knot=4; dist=1; dia=0.2; par=ParametricPlot3D[{(ext+Cos[turn x]) Cos[knot x],(ext+Cos[turn x]) Sin[knot x],dist Sin[turn x]},{x,0,2 Pi},PlotStyle->Tube[dia],PlotRange->All,Axes->False,Boxed->False,ViewPoint->{0,0,6},ColorFunction->"DeepSeaColors",ImageSize->{400,300},DisplayFunction:>((RenderSZG[#];#)&)]

■     Regions where xyz<1 displayed with RegionPlot3D

RegionPlot3D[(x y z<1)&&(x+y+z<1),{x,-5,5},{y,-5,5},{z,-5,5},PlotStyle->Directive[Yellow,Opacity[0.5]],Mesh->None,DisplayFunction:>((RenderSZG[#];#)&)]

■     Awesome Sphere displayed with SphericalPlot3D
[Note the MaxRecursion level  for adaptive mesh refinement is 1 for a jagged surface.  Increasing it to 2 or 3 takes longer to render but looks nicer.]

RenderSZG[SphericalPlot3D[Sin[5x + 7 y],x,y,ColorFunction->(ColorData["Rainbow"][#6]&),Mesh->None,PlotPoints->35,Boxed->False,Axes->False,MaxRecursion->3]]

To adapt your own Mathematica surface to display in the Cube, do one of the following; it makes no difference :

■     Add this before the closing bracket in the function:

,DisplayFunction:>((RenderSZG[#];#)&)

■     Place your function between the brackets in this:

RenderSZG[]

Look at the last two examples (RegionPlot3D and SphericalPlot3D) to see the difference in implementations.