This example presents the basic concepts behind the direct manipulation of parametrized graphics in LiveGraphics3D. The three coordinates of the thick point at the end of the line in this scene are (internally) specified by three parameters (independent variables). Thus, you may drag this point to a new position. (Just move the mouse over the point such that the point is boxed. Then press the left mouse button, and hold it down while you move the mouse.) As the same parameters are employed for the specification of the diagonal line and its midpoint, they will change their positions accordingly. |
Here is how to create this example within Mathematica:
scene = Graphics3D[{Line[{{0,0,0},{x,y,z}}], PointSize[0.05],Point[{x,y,z}],PointSize[0.03],Point[{mx,my,mz}]}]; dependentVariables = {mx->x/2,my->y/2,mz->z/2}; independentVariables = {x->3, y->2, z->1}; Show[scene //. dependentVariables /. independentVariables];
After you have created the parametrized Graphics3D object within Mathematica, you can display it in an HTML page using LiveGraphics3D with the following HTML code snippet:
<HTML> <BODY> ... <APPLET ARCHIVE="live.jar" CODE="Live.class" WIDTH=300 HEIGHT=300> <PARAM NAME=DEPENDENT_VARIABLES VALUE="{mx->x/2,my->y/2,mz->z/2}"> <PARAM NAME=INDEPENDENT_VARIABLES VALUE="{x->3, y->2, z->1}"> <PARAM NAME=INPUT VALUE="Graphics3D[{Line[{{0,0,0},{x,y,z}}], PointSize[0.05],Point[{x,y,z}],Point[{mx,my,mz}]}]"> </APPLET> ... </BODY> </HTML>
If LiveGraphics3D complains about a syntax error, you should make sure that the correct version of the file live.jar is loaded (0.57beta or higher), i.e. you should reload the page (hold down the SHIFT key when clicking the reload button), empty all caches, and deactivate any proxy. If this does not help, please let me know.