MathGroup Archive 2006

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

Search the Archive

Re: Packages--guikit and mathgl3d help!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66949] Re: Packages--guikit and mathgl3d help!
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Mon, 5 Jun 2006 03:47:48 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <e5tt6o$ea4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

green_man_2004 at yahoo.com wrote:
> as i was trying to make a graphical interface with an output of 3d graphics
>  i have failed to run both guikit and mathgl3d packages at the same time. 
> do anybody have any information about this problem?

What problem?

The following lines work perfectly: the calculator -- from GUIKit -- and 
the Klein bottle -- from MathGL3D -- are displayed concurrently and both 
of them can be used/manipulated.

In[1]:=
Needs["GUIKit`"];

In[2]:=
GUIRun["Wolfram/Example/Calculator"]

Out[2]=
GUIObject[JLink`Objects`JavaObject180685885145089,
   JLink`Objects`JavaObject447893567700993]

In[3]:=
<< "MathGL3d`OpenGLViewer`";

In[4]:=
Off[CompiledFunction::cfse]
bx = 6*Cos[u]*(1 + Sin[u]);
by = 16*Sin[u];
rad = 4*(1 - Cos[u]/2);
X = If[Inequality[Pi, Less, u, LessEqual, 2*Pi],
     bx + rad*Cos[v + Pi], bx + rad*Cos[u]*Cos[v]];
Y = If[Inequality[Pi, Less, u, LessEqual, 2*Pi], by,
     by + rad*Sin[u]*Cos[v]];
Z = rad*Sin[v];
kleinb = ParametricPlot3D[{X, Y, Z}, {u, 0, 2*Pi},
     {v, 0, 2*Pi}, PlotPoints -> {48, 12},
     Axes -> False, Boxed -> False,
     ViewPoint -> {0.893496, -1.73314, -1.9499},
     LightSources -> {{{0.33518, -1.1415, -0.76458},
        RGBColor[1., 0., 0.]},
       {{1.5922, 0., -0.681822}, RGBColor[0., 1., 0.]},
       {{0.5276, -0.82099, -1.0235144},
        RGBColor[0., 0., 1.]}, {{0., 0., 1.5},
        RGBColor[0.25, 0.25, 0.25]}},
     DisplayFunction -> Identity];
On[CompiledFunction::cfse]

In[13]:=
MVShow3D[kleinb, MVPolygonShading -> MVSmooth,
   MVNewScene -> True]

Out[13]=
{MVMesh3D[2], PlotRange ->
    {{-13.090739968238584, 9.754283822034726},
     {-15.991065019684074, 20.055623908350213},
     {-5.934507868443345, 5.934507868443346}},
   ViewPoint -> {0.893496, -1.73314, -1.9499},
   AmbientLight -> {0., 0., 0.}}

In[14]:=
$Version

Out[14]=
"5.2 for Microsoft Windows (June 20, 2005)"

HTH,
Jean-Marc


  • Prev by Date: Re: Problem with Limit
  • Next by Date: Re: Re: New Analytical Functions - Mathematica Verified
  • Previous by thread: Packages--guikit and mathgl3d help!
  • Next by thread: Re: Packages--guikit and mathgl3d help!