(* File : OpenGLViewer.m, eventual edit the $MVTexturePath value. *) (* (c) Jens-Peer Kuska 1997,98,99 *) (* The file is automatical generated by the +mvcp switch *) (* Mathematica startup file of "GL Viewer for Mathematica" *) (* Version 2.2 *) Begin["System`"] (* Translate the $System to a valid directory name *) sysName[] := Module[{sys}, sys = StringReplace[$System, " " -> ""]; If[StringMatchQ[sys, "*Windows*"], "Windows", sys ] ] (* Get the binary name for the system s *) binName[s_String] := Switch[s, "PowerMacintosh", "mathview3d", (* Macintosh *) "Windows", "mathview3d.exe -mathlink", (* MS Windows *) _, "mathview3d -mathlink" (* Unix *) ] (* Make the argument for LinkOpen[] *) $mathGLCall=StringJoin[ ToFileName[ {$TopDirectory, "AddOns", "Applications", "MathGL3d","Binaries", sysName[]}], binName[sysName[]] ] If[!MemberQ[Links[],$MVLink], If[$System=="Power Macintosh", $mathGLCall=StringReplace[$mathGLCall," "->"' '"]; (* Replace eventual spaces in the path name *) $MVLink=Install[$mathGLCall], $MVLink=Install[LinkOpen[$mathGLCall]]; Unprotect[ParametricPlot3D]; Clear[ParametricPlot3D]; Protect[ParametricPlot3D] ], Print["The OpenGLViewer is running."] ]; MVShowWindow[]; Unprotect[MVClose]; Clear[MVClose]; MVClose[]:=Uninstall[$MVLink] Protect[MVClose]; End[]; AppendTo[ $MVTexturePath, ToFileName[ {$TopDirectory,"AddOns", "Applications","MathGL3d","Textures"}] ];