[Date Index]
[Thread Index]
[Author Index]
Re: Interactive surface manipulation with GUIkit
*To*: mathgroup at smc.vnet.net
*Subject*: [mg61022] Re: Interactive surface manipulation with GUIkit
*From*: "Martin Kraus" <martin_kraus_germany at yahoo.com>
*Date*: Sat, 8 Oct 2005 02:48:28 -0400 (EDT)
*References*: <dh8aan$svc$1@smc.vnet.net><di59j2$3g8$1@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
Marco,
there are several ways of obtaining the values of variables in
LiveGraphics3D. One is to print the current values to the
Java Console (by pressing "o"). The problem with that is
to find a web browser which can display the Java console;
apparently most of the web browsers don't allow you
to show the Java console. (I think IE called it "Java Messages"
but I guess this also vanished in recent versions.)
The second way is to call a public Java function of the applet
(e.g. via J/Link or JavaScript, but this would require you to
either call the applet from Mathematica via J/Link or
communicate with the applet via JavaScript; both ways
would probably require too much effort).
Thus, the best way for you is probably just to have some
Text primitives which show the values. (LiveGraphics3D
allows you to have a single identifier of a variable (without
quotation marks!) as the first argument of Text and then
uses the current value of that variable for the output.
I've updated the example accordingly.
http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/examples/bilinear/
Hope this helps
Martin
Marco Gabiccini ha escrito:
> Hi Martin,
>
> thanks for your precious help. I tried your example and it worked very well.
>
> I still have a question: my objective is to manipulate the surface visually
> and, when it is ok for me, to obtain the numeric values for f1, f2, f3, f4
> after the change.
> This is actually the main aim of the process.
>
> Regarding specifically your bilinear example:
> is that possible to retrieve those final values? or once you have creted
> the .m file after the first run of the notebook the values fi (i=1,..4) are
> frozen?
>
> Thanks,
>
> Marco
>
> At 04:08 AM 10/6/2005 -0400, you wrote:
> >Hello,
> >
> >I don't know how this works with GUIkit.
> >For the interactive part, I would suggest parametric graphics
> >with LiveGraphics3D. The idea is to use variables (here: f1,f2,f3,f4)
> >in your graphics. Unfortunately Plot3D cannot handle such graphics,
> >thus, you have to build up it with low-level Mathematica graphics:
> >
> >independentVariables = {f1 -> 2, f2 -> 1, f3 -> 0, f4 -> 2.5};
> >n1[x_, y_] := (1/4)(1 + x)(1 + y);
> >n2[x_, y_] := (1/4)(1 - x)(1 + y);
> >n3[x_, y_] := (1/4)(1 - x)(1 - y);
> >n4[x_, y_] := (1/4)(1 + x)(1 - y);
> >f[x_, y_] := {n1[x, y], n2[x, y], n3[x, y], n4[x, y]}.{f1, f2, f3, f4};
> >dx = 2/10; dy = 2/10;
> >g = Graphics3D[{{PointSize[0.02], RGBColor[0, 1, 0], Point[{1, 1,
> > f1}], Point[{-1, 1, f2}], Point[{-1, -1, f3}], Point[{1, -1, f4}]},
> >
> > Table[Polygon[{{x, y, f[x, y]}, {x + dx, y, f[x + dx, y]}, {x +
> > dx, y + dy, f[x + dx, y + dy]}, {x, y + dy, f[x, y + dy]}}],
> >{x, -1,
> > 1 - dx, dx}, {y, -1, 1 - dy, dy}]}];
> >
> >To show this example in Mathematica, use:
> >
> >Show[g //. independentVariables]
> >
> >For use with LiveGraphics3D, use the WriteLiveForm function
> >from the LiveGraphics3D documentation
> >http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/documentation.html
> >Then you need an HTML page calling this applet with the
> >additional parameter
> ><PARAM NAME="INDEPENDENT_VARIABLES" VALUE="{f1 -> 2, f2 -> 1, f3 -> 0,
> >f4 -> 2.5}">
> >The rest is a standard call of LiveGraphics3D as described
> >in the documentation.
> >I've set up an example (including Mathematica source and HTML file) here:
> >http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/examples/bilinear/
> >
> >Note that the green points are included to have draggable
> >points in LiveGraphics3D. (They are draggable in z direction
> >because their z coordinate is specified directly by an
> >independent variable.)
> >Also note that the shading is never updated and only correct
> >for the initial values of the variables.
> >Finally note, that no Java programming was necessary to
> >create this example. Once you know how it works; it is actually
> >pretty straightforward to produce such examples.
> >
> >Hope this helps
> >
> >Martin Kraus
Prev by Date:
**Re: Globally limiting precision or accuracy**
Next by Date:
**Re: Re: "Mathematica in Education and Research"**
Previous by thread:
**Re: Re: Interactive surface manipulation with GUIkit**
Next by thread:
**Histogram with more than one dataset**
| |