Re: Re: Interactive surface manipulation with GUIkit

*To*: mathgroup at smc.vnet.net*Subject*: [mg61004] Re: [mg60981] Re: Interactive surface manipulation with GUIkit*From*: Marco Gabiccini <m.gabiccini at ing.unipi.it>*Date*: Fri, 7 Oct 2005 03:37:48 -0400 (EDT)*References*: <dh8aan$svc$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

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