(*^ ::[ frontEndVersion = "Microsoft Windows Mathematica Notebook Front End Version 2.2"; microsoftWindowsStandardFontEncoding; fontset = title, "Times", 24, L0, center, nohscroll, bold; fontset = subtitle, "Times", 18, L0, center, nohscroll, bold; fontset = subsubtitle, "Times", 14, L0, center, nohscroll, italic; fontset = section, "Times", 18, L0, nohscroll, bold, grayBox; fontset = subsection, "Times", 14, L0, nohscroll, bold, blackBox; fontset = subsubsection, "Times", 13, L0, nohscroll, B32896; fontset = text, "Times", 12, L0, nohscroll, cellOutline; fontset = smalltext, "Times", 10, L0, nohscroll; fontset = input, "Courier", 12, L-4, nowordwrap, bold; fontset = output, "Courier", 12, L-4, nowordwrap; fontset = message, "Courier", 12, L-4, nowordwrap, R32896; fontset = print, "Courier", 12, L-4, nowordwrap; fontset = info, "Courier", 12, L-4, nowordwrap, B32896; fontset = postscript, "Courier", 12, L0, nowordwrap; fontset = name, "Geneva", 10, L0, nohscroll, italic; fontset = header, "Times", 12, L0; fontset = footer, "Times", 12, L0, center; fontset = help, "Times", 10, L0, nohscroll; fontset = clipboard, "Times", 12, L0, nohscroll; fontset = completions, "Times", 12, L0, nohscroll; fontset = graphics, "Courier New", 10, L0, nowordwrap, nohscroll; fontset = special1, "Times", 12, L0, nohscroll; fontset = special2, "Times", 12, L0, nohscroll; fontset = special3, "Times", 12, L0, nohscroll; fontset = special4, "Times", 12, L0, nohscroll; fontset = special5, "Times", 12, L0, nohscroll; fontset = leftheader, "Times", 12, L2; fontset = leftfooter, "Times", 12, L2; fontset = reserved1, "Courier New", 10, L0, nowordwrap, nohscroll;] :[font = title; inactive; preserveAspect; nohscroll; center; ] MathLive Professional :[font = subsubsection; inactive; preserveAspect; nohscroll; ] We strongly recommend that you read the tutorial notebook first. This notebook is intended to provide a reference guide only. :[font = section; inactive; preserveAspect; startGroup; Cclosed; nohscroll; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 32896; fontColorGreen = 0; fontColorBlue = 0; bold; fontName = "Times"; fontSize = 18; ] Description :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] MathLive Control Commands :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The MathLive package should be initialised using :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Needs["MathLive`MathLive`"] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The MathLink connection between the Kernel and MathLive should be established with either LaunchLive in the case that MathLive has not been started, or ConnectLive in the case that MathLive has been started manually. The full form of these commands are :[font = input; preserveAspect; endGroup; nowordwrap; ] LaunchLive[("ApplicationName"), (MathLinkOptions) ] ConnectLive[("LinkName"), (MathLinkOptions) ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] To reset the camera and default model use :[font = input; preserveAspect; endGroup; nowordwrap; ] ResetLive[] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The application can be closed with :[font = input; preserveAspect; endGroup; nowordwrap; ] CloseLive[]; :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Note that setting QuitLive->False will stop Mathematica from attempting to send a termination message to MathLive. This is useful if the link is dead and Mathematica 'hangs' whilst trying to send messages to the link. The full form for CloseLive is :[font = input; preserveAspect; endGroup; nowordwrap; ] CloseLive[QuitLive -> True / False] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Once connected, MathLive's application details can be found. These are normally printed during startup. :[font = input; preserveAspect; endGroup; nowordwrap; ] LiveApplicationDetails[] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] To check that the version of MathLive running has the required features use LiveVersion. :[font = input; preserveAspect; endGroup; nowordwrap; ] LiveVersion[ (versionNumberRequired ) ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] SetDisplay allows setting of $DisplayFunction to suppress or generate 3D graphics in your chosen output medium. :[font = input; preserveAspect; endGroup; endGroup; nowordwrap; ] SetDisplay[ (NoteBook -> True/On/False/Off) , (Live -> True/On/False/Off)] :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Live[ ... ] Commands :[font = subsubsection; inactive; preserveAspect; nohscroll; ] Graphics3D and SurfaceGraphics can be rendered in MathLive. New objects will be given a unique name. The object reference will be of the form Object3D["Object 1"]. Objects created using Create with an explicit name in the same model context will overwrite any existing objects with the same name. :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Objects and models can be created using Live[ Create[ ... :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Create[ Model3D[ "myModel`" ] ] Create[ Object3D[ "myObject" ] , graphics ] Create[ Object3D[ "myModel`myObject" ] , graphics ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] And destroyed :[font = input; preserveAspect; endGroup; nowordwrap; ] Destroy[ Model3D[ "myModel`" ] ] Destroy[ Object3D[ "myObject"] ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] A list of commands is always executed sequentially, one for each render of the scene. The list can also be used as an animation script for a quicktime movie. :[font = input; preserveAspect; endGroup; nowordwrap; ] { animationFrames } RecordMovie[ "Filename.qt", { animationFrames } ] (Macintosh only) :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Objects, models and the Camera can be explicitly changed and moved. The amount the object moves will depend upon the model coordinate system, set by ModelRange -> ... See the reference to ModelRange in the Advance notebook for further information. Translate generates a relative movement, Locate generates an absolute movement. :[font = input; preserveAspect; endGroup; nowordwrap; ] Translate[ reference , { tx, ty, tz }] Locate[ reference , { x, y, z }] :[font = subsubsection; inactive; preserveAspect; nohscroll; ] A list of objects can be supplied to the command Change. Options can be grouped as a list, or supplied as separate arguments. :[font = subsubsection; inactive; preserveAspect; nohscroll; ] Change[ reference(s) , option(s) ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] FaceForm functionality has been extended. Specifying "None" or "Null" in the front or back polygon descriptions will give single sided polygons - without front, or back faces respectively. This saves memory and speeds up the rendering process. :[font = input; preserveAspect; endGroup; nowordwrap; ] FaceForm[ color, None ] FaceForm[ None , color ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] AbsoluteThickness are treated as their non-Absolute versions. :[font = input; preserveAspect; endGroup; endGroup; nowordwrap; ] AbsoluteThickness treated as Thickness AbsolutePointSize treated as PointSize :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Enquiry Functions :[font = subsubsection; inactive; preserveAspect; nohscroll; ] Enquiry functions are always evaluated immediately. They do not need to be wrapped with Live[ ... ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The last object created can be identified as can the last object that the user has selected. If the user has no object currently selected, CurrentObjectTouched[] returns None. These functions also return None if the object has been destroyed and no longer exists. :[font = input; preserveAspect; endGroup; nowordwrap; ] CurrentObjectTouched[] LastObjectCreated[] LastObjectTouched[] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The names of all objects created within the model can be found using ListObjects. :[font = input; preserveAspect; endGroup; nowordwrap; ] ObjectList[ Model3D[ "myModel`" ] ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The ModelRange, i.e. the model coordinate system that objects use, can be determined using ModelRange[ ... ] This maps the object's coordinate system to the global coordinate system of the model which has a size of one unit. :[font = input; preserveAspect; endGroup; endGroup; nowordwrap; ] ModelRange[ Model3D[ "myModel`" ] ] :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] 3x3 and 4x4 Matrices :[font = input; preserveAspect; nowordwrap; ] Live[ Change[ Object3D["fred"] , Matrix -> .... ] ] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The normal 3x3 unrotated matrix is the identity matrix :[font = input; preserveAspect; endGroup; nowordwrap; ] { { 1,0,0} , { 0,1,0} , { 0,0,1} } :[font = subsubsection; inactive; preserveAspect; nohscroll; ] Any 3x3 matrix should be orthogonal and have an inverse. Scaling is ignored. The matrix is orthonormalised before being used. A matrix that can not be orthonormalised is ignored. :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] A useful way to think of the 3x3 matrix is that each line encodes the x, y and z directions of the object in terms of the true coordinate axes, i.e. { object"X" , object"Y" ,object"Z" }. For example :[font = input; preserveAspect; endGroup; nowordwrap; ] { { 1,-1, 0} , { 1,1,0} , {0,0,1} } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] has the object's X axis pointing along the world {1,-1,0} direction. Please note that in MathLive, X points to the right, Y away from the camera, and Z up, In the example above we have preserved the right-handedness of the coordinate system and rotated -45 degrees about the Z axis. A more general format would be :[font = input; preserveAspect; endGroup; nowordwrap; ] zAngle = - Pi/4; c = Cos[zAngle]; s = Sin[zAngle]; { {c,s,0} , {c,-s,0} , {0,0,1} } :[font = subsubsection; inactive; preserveAspect; nohscroll; ] It is only the directionality of each vector component that is important so {1,-1,0} is equivalent to { 0.707, -0.707, 0 } . An easier method of obtaining a rotation about a given axis is to use the axis notation (AxisAndAngle -> {{0,0,1},Pi/4} ). The scale of an object remains unaffected. :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] A 4x4 matrix encodes the orientation, scale and location of an object. An unscaled, unrotated, unmoved object is represented by the identity matrix. The last column of the 4x4 matrix is unused. :[font = input; preserveAspect; endGroup; nowordwrap; ] { { r11 , r12 , r13 , 0 } , { r21 , r22 , r23 , 0 } , { r31 , r32 , r33 , 0 } , { x , y , z , 1 } } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The top left hand corner is the 3 x 3 matrix we have already discussed, except it now includes scaling information. The "x y z" components mark the location of the object. If the orientation matrix is normalised properly, the scaling along each axis "sx, sy, sz" can be represented as - :[font = input; preserveAspect; endGroup; nowordwrap; ] { sx{ r11 , r12 , r13 , 0 } , sy{ r21 , r22 , r23 , 0 } , sz{ r31 , r32 , r33 , 0 } , 1{ x , y , z , 1 } } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] For example, the following 4x4 matrix represents a scaling factor of two along the y axis- :[font = input; preserveAspect; endGroup; nowordwrap; ] { { 1,0,0,0 } , { 0,2,0,0 } , { 0,0,1,0 } , { 0,0,0,1 } } :[font = subsubsection; inactive; preserveAspect; endGroup; nohscroll; ] This change in scale could also be written in the form Scale-> {1,2,1} :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Object Attributes :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] An objects attributes can be changed using the form :[font = input; preserveAspect; endGroup; nowordwrap; ] Live[Change[object, a->b]] :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] An object's surface properties can be changed. Colors are applied sequentially to each polygon of the object. :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Specular -> number 0...1 Ambient -> number 0...1 Diffuse -> number 0...1 Opacity -> number 0...1 ( 0 = Transparent, 1 = Solid ) RenderMode -> PointCloud / WireFrame / FlatShaded / SmoothShaded Color -> { foreColor(s), BackColor(s) } Color -> Color :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Objects can be made visible or invisble. When applied to the camera, the camera icon is shown or hidden. :[font = input; preserveAspect; endGroup; nowordwrap; ] Visible -> On / Off :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] An object can be moved to an absolute location using :[font = input; preserveAspect; endGroup; nowordwrap; ] Location -> { x, y, z } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] An object's position and orientation can be locked against mouse interactions. Attempts to move a locked object will move its parent instead (usually the model). :[font = input; preserveAspect; endGroup; nowordwrap; ] MouseMovement -> True / On / False / Off :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Objects and models can be scaled. The scale along each axis can be given separately. The invariant point is the current PointOfRotation :[font = input; preserveAspect; endGroup; nowordwrap; ] Scale -> +ve number or Reset Scale -> { +ve number, +ve number, +ve number } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] An object, model or camera's orientation can be explicitly given as a 3x3 matrix. Note that the matrix is internally normalised so scaling information will be lost. Alternatively, a full 4x4 matrix will set the orientation, scale and location in one operation. :[font = input; preserveAspect; endGroup; nowordwrap; ] Matrix -> "3x3OrientationMatrix" Matrix -> "4x4OrientationLocationScaleMatrix" :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Three more methods exist to set the orientation . :[font = input; preserveAspect; nowordwrap; ] // Yaw - Around World Z. Pitch - Around Rotated Objects Y, // Roll- Around Rotated Objects X :[font = input; preserveAspect; endGroup; nowordwrap; ] YawPitchRoll -> { yawAngle, pitchAngle, rollAngle } or Reset Euler -> { omega, theta, psi } or Reset AxisAndAngle -> { { x, y, z } , theta } :[font = subsubsection; inactive; preserveAspect; nohscroll; ] YawPtichRoll defines a rotation matrix in terms of a 'yaw' rotation about the Z axis, 'pitch' rotation about the new X axis and finally a 'roll' rotation about the Y axis, Euler defines a rotation matrix in terms of a 'omega' rotation about the Z axis, 'theta' rotation about the new Y axis and finally a 'psi' rotation about the new Z axis, AxisAndAngle defines a rotation by the invariant axis and the angle of rotation. Refer to the Rotation and AirPlane example notebooks for more details. :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The invariant point of rotation can be set to a location or an 'arbitrary' central point. The latter can be useful to rotate surface plots, the former when building a virtual world. The centre is defined as the centre of the enclosing X-Y-Z bounding box around the object. :[font = input; preserveAspect; endGroup; nowordwrap; ] PointOfRotation -> { x, y, z } PointOfRotation -> Centre / Center :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The model's bounding box can be turned on and off. The ModelRange can be explicity set. The first, preferred, form is identical to PlotRange. :[font = input; preserveAspect; endGroup; nowordwrap; ] ShowBoundingBox -> True / On / False / Off ModelRange -> { { xMin, xMax}, { yMin, yMax} , { zMin, zMax }} ModelRange -> { { xMin, yMin, zMin} , { xMax, yMax, zMax } } :[font = subsubsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] The Camera can exist in the world coordinate system or within the model's coordinate system. When the Camera's parent is set to the model, the Camera location must be specified in model (i.e. object) coordinates and, like objects, will be scaled by the modelRange. :[font = input; preserveAspect; endGroup; endGroup; endGroup; nowordwrap; ] Parent -> Model3D["myModel`"] Parent -> None :[font = section; inactive; preserveAspect; startGroup; Cclosed; nohscroll; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 32896; fontColorGreen = 0; fontColorBlue = 0; bold; fontName = "Times"; fontSize = 18; ] Syntax :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] MathLive Control Commands (Starting and Stopping) :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Needs["MathLive`MathLive`"] LaunchLive[("ApplicationName"), (MathLinkOptions) ] ConnectLive[("LinkName"), (MathLinkOptions) ] ResetLive[] CloseLive[QuitLive -> True / False] LiveApplicationDetails[] LiveVersion[ (versionNumberRequired ) ] SetDisplay[ (NoteBook -> True/On/False/Off) , (Live -> True/On/False/Off)] :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Live[ ... ] Commands :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Graphics3D[...] Create[ Model3D[ "myModel`" ] ] Create[ Object3D[ "myObject" ] , graphics ] Create[ Object3D[ "myModel`myObject" ] , graphics ] Destroy[ Model3D[ "myModel`" ] ] Destroy[ Object3D[ "myObject"] ] { animationFrames } RecordMovie[ "Filename.qt", { animationFrames } ] (Macintosh only) Translate[ reference , { tx, ty, tz }] Locate[ reference , { x, y, z }] Change[ reference(s) , options(s) ] (see "Object Attributes" below) FaceForm[ color, None ] (New FaceForm Feature) FaceForm[ None , color ] (New FaceForm Feature) AbsoluteThickness treated as Thickness AbsolutePointSize treated as PointSize :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Enquiry Functions :[font = input; preserveAspect; endGroup; nowordwrap; ] CurrentObjectTouched[] LastObjectCreated[] LastObjectTouched[] ObjectList[ Model3D[ "myModel`" ] ] ModelRange[ Model3D[ "myModel`" ] ] :[font = subsection; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Object Attributes Live[ Change[ reference , options ] ] :[font = input; preserveAspect; endGroup; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] Specular -> number 0...1 Ambient -> number 0...1 Diffuse -> number 0...1 Opacity -> number 0...1 ( 0 = Transparent, 1 = Solid ) RenderMode -> PointCloud / WireFrame / FlatShaded / SmoothShaded Color -> { foreColor(s), BackColor(s) } Color -> Color Visible -> On / Off Location -> { x, y, z } MouseMovement -> True / On / False / Off Scale -> +ve number / Reset Scale -> { +ve number, +ve number, +ve number } Matrix -> "3x3OrientationMatrix" Matrix -> "4x4OrientationLocationScaleMatrix" YawPitchRoll -> { yawAngle, pitchAngle, rollAngle } / Reset Euler -> { omega, theta, psi } / Reset AxisAndAngle -> {{ x, y, z } , theta } / Reset PointOfRotation -> { x, y, z } PointOfRotation -> Centre / Center ShowBoundingBox -> True / On / False / Off ModelRange -> { { xMin, xMax}, { yMin, yMax} , { zMin, zMax }} ModelRange -> { { xMin, yMin, zMin} , { xMax, yMax, zMax } } Parent -> Model3D["myModel`"] Parent -> None :[font = section; inactive; preserveAspect; startGroup; Cclosed; nohscroll; ] Glossary :[font = input; preserveAspect; endGroup; nowordwrap; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Courier"; fontSize = 12; ] graphics refers to a valid Graphics3D or SurfaceGraphics expression. reference refers to a camera, model or object reference. For example- Camera["Camera"] , Model3D["Default`"] and Object3D["Object 1"] animationFrames refers a single or a list of commands to be executed before the next render of the scene. 3x3Matrix refers to an orientation transformation matrix with three rows and three columns. 4x4Matrix refers to a complete transformation matrix with four rows and four columns. Color refers to GrayLevel, Hue, CMYKColor or RGBColor Angles are expressed in radians. ( ) - optional arguments :[font = section; inactive; preserveAspect; nohscroll; ] For further information, advice or suggestions please contact- :[font = text; inactive; preserveAspect; nohscroll; cellOutline; backColorRed = 65535; backColorGreen = 65535; backColorBlue = 65535; fontColorRed = 0; fontColorGreen = 0; fontColorBlue = 0; plain; fontName = "Times"; fontSize = 12; ] Email: support@milohedge.com Post: Milo Hedge Ltd, The Oxford Centre for Innovation, Mill Street, Oxford, OX2 0JX WWW: http://www.milohedge.com/mathlive/ ^*)