(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 38612, 993]*) (*NotebookOutlinePosition[ 39325, 1018]*) (* CellTagsIndexPosition[ 39281, 1014]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Directx 9 shader tutorial #2 (Adapted from the Directx and NVidia SDKs)\ \>", "Title"], Cell[CellGroupData[{ Cell["October 2005", "Subsection"], Cell[BoxData[ \(\(pathtoactivenotebook\ = \ Rest[First[ Last[First[ NotebookInformation[ EvaluationNotebook[]\ ]\ ]\ ]\ ]];\)\)], "Input"], Cell[BoxData[{ \(\(DirectoryListToPath[a_List]\ := \ StringJoin\ @@ \ Flatten[{Table[ StringJoin[ ToString[\ a[\([i]\)]\ ], \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $PathnameSeparator], \ {i, \ 1, \ Length[a]\ - \ 1}], \ a[\([\(-1\)]\)]}];\)\ \), "\n", \(\(folderName\ = \ DirectoryListToPath[pathtoactivenotebook];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Load .NET", "Section"], Cell[BoxData[ \(<< NETLink`\)], "Input"], Cell[BoxData[ \(\(\( (*\ if\ debugging\ connect\ with\ the\ LINK\ \ *) \)\(\[IndentingNewLine]\)\(If[ True, \ \(ReinstallNET[];\), \[IndentingNewLine]\(InstallNET[ LinkConnect["\"]];\)\[IndentingNewLine]];\)\)\ \)], "Input"], Cell[BoxData[ \(<< JLink`\)], "Input"], Cell[BoxData[{ \(device\ = Null; \ \ (*\ Checked\ against\ Null, \ so\ initialize\ *) \), "\n", \(\(effect = Null;\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Load the NET Assemblies", "Section"], Cell[BoxData[{ \(\(LoadNETAssembly["\"];\)\), "\n", \(\(LoadNETAssembly["\"];\)\), "\n", \(\(LoadNETAssembly["\"];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Load the common NET types", "Section"], Cell["\<\ I don't think all the types here are needed for this example, but no harm \ done in loading them.\ \>", "Text"], Cell[BoxData[{ \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \ \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \ \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n\ ", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n\ ", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), \ "\n", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\ \n", \(\(LoadNETType["\"];\)\), "\n\ ", \(\(LoadNETType["\"];\)\), "\n\ ", \(\(LoadNETType["\"];\)\), "\n", \(\(LoadNETType["\"];\)\), "\n", \ \(\(LoadNETType["\"];\)\), "\ \[IndentingNewLine]", \(\(LoadNETType["\"];\)\), "\ \[IndentingNewLine]", \(\(LoadNETType["\"];\)\), \ "\[IndentingNewLine]", \(\(LoadNETType["\"];\)\), \ "\[IndentingNewLine]", \(\(LoadNETType["\"];\)\), \ "\[IndentingNewLine]", \(\(LoadNETType["\"];\)\), "\ \[IndentingNewLine]", \(\(LoadNETType["\"];\)\)}], \ "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Point the direct x directory to the file logo.bmp", "Section"], Cell[BoxData[ \(\(Directory`SetCurrentDirectory[folderName];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(LoadNETAssembly[ ToFileName[folderName, "\"]]\)], "Input"], Cell[BoxData[ \(NETAssembly["VertexBufferUtils", 5]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(result = LoadNETType["\"]\)], "Input"], Cell[BoxData[ \(NETType["VertexBufferUtils", 37]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(useFastDLL = result[\([0]\)] \[Equal] NETType;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(myVertexBufferUtils = NETNew["\"]\)], "Input"], Cell[BoxData[ InterpretationBox[\(\[LeftGuillemet] NETObject[VertexBufferUtils] \[RightGuillemet]\), NETLink`Objects`NETObject$167772161]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Helper Functions", "Section"], Cell[BoxData[{ \(\(hex2Int[str_] := Module[{temp}, temp = \(\((If[# \[LessEqual] \ \(ToCharacterCode["\<9\>"]\)[\([1]\)], # - \(ToCharacterCode["\<0\>"]\)[\([1]\ \)], If[# \[LessEqual] \(ToCharacterCode["\"]\)[\([1]\)], # - \ \(ToCharacterCode["\"]\)[\([1]\)] + 10, If[# \[LessEqual] \ \(ToCharacterCode["\"]\)[\([1]\)], # - \(ToCharacterCode["\"]\)[\([1]\ \)] + 10]]])\) &\) /@ ToCharacterCode[str]; \[IndentingNewLine]FromDigits[ temp, 16]];\)\), "\n", \(\(\(hex2Int::usage = "\";\)\(\n\) \)\), "\[IndentingNewLine]", \(\(int2Hex[value_] := StringJoin[\(\((If[# < 10, FromCharacterCode[48 + #], FromCharacterCode[55 + #]])\) &\) /@ IntegerDigits[value, 16]];\)\), "\n", \(\(int2Hex::usage = "\";\)\)}], "Input"], Cell[BoxData[ \(\(normalizeVector[u_] := If[Sqrt[u . u] > 0. , \ u/Sqrt[u . u], u];\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Define the Plot3D and extract key values", "Section"], Cell[CellGroupData[{ Cell["We get position, normal, uv", "Subsection"], Cell[BoxData[ \(\(steps = 64;\)\)], "Input"], Cell[BoxData[ \(\(pointData = Flatten[Table[ Chop[{\[IndentingNewLine] (*\ point\ *) \[IndentingNewLine]Cos[long] Cos[lat], Sin[long] Cos[lat], Sin[lat], \[IndentingNewLine] (*\ normals\ *) \[IndentingNewLine]Cos[long] Cos[lat], Sin[long] Cos[lat], Sin[lat], \[IndentingNewLine] (*\ uvs\ *) \[IndentingNewLine]\((long + Pi)\)/\((2. \ Pi)\), 1 - \((lat + Pi/2. )\)/Pi, \[IndentingNewLine] (*\ tangents\ *) \[IndentingNewLine]\(-Sin[long]\), Cos[long], 0\[IndentingNewLine]}], {lat, \(-Pi\)/2. , Pi/2. , N[Pi/steps]}, {long, \(-1. \)\ Pi, 1. \ Pi, 2. *Pi/steps}\ ], 1];\)\)], "Input"], Cell[BoxData[{ \(\(points = \(Take[#, 3] &\)\ /@ \ pointData;\)\), "\[IndentingNewLine]", \(\(normals = \ \(Take[#, {4, 6}] &\)\ /@ \ pointData;\)\), "\[IndentingNewLine]", \(\(uvs = \(Take[#, {7, 8}] &\)\ /@ \ pointData;\)\), "\[IndentingNewLine]", \(\(tangents\ = \ \(Take[#, {9, 11}] &\)\ /@ \ pointData;\)\), "\[IndentingNewLine]", \(\(biNormals\ = \ Cross\ @@@ \ Transpose[{normals, tangents}];\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Print[ Length\ /@ \ {points, normals, tangents, biNormals, uvs}];\)\)], "Input"], Cell[BoxData[ \({4225, 4225, 4225, 4225, 4225}\)], "Print"] }, Open ]], Cell[BoxData[ \(\(triangles\ = \ Flatten[Table[{{i, i + steps + 1, i + steps + 2}, {i + 1, i, i + steps + 2}} + j*\((steps + 1)\), {i, 1, steps}, {j, 0, steps - 1}], 2]\ ;\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["We will use some display data from the graphic, just for fun", \ "Subsection"], Cell[BoxData[ \(\(g = Graphics3D[\[IndentingNewLine]{\[IndentingNewLine]{EdgeForm[], Polygon[triangles[#]] /@ \ points}, \[IndentingNewLine] (*\ Tangents\ *) \[IndentingNewLine]Green, \ Line\ /@ \ Transpose[{points, points + tangents/4}], \[IndentingNewLine]Red, Line\ /@ \ Transpose[{points, points + normals/4}], \[IndentingNewLine]Blue, Line\ /@ \ Transpose[{points, points + biNormals/4}]\[IndentingNewLine]}, ImageSize \[Rule] {500, 500}];\)\)], "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Extract data from the graphics", "Section"], Cell[BoxData[ \(\(minIndexTriangles = Min[Flatten[triangles]];\)\)], "Input"], Cell[BoxData[ \(\(numVerticesTriangles = \ Max[Flatten[triangles]] - minIndexTriangles + 1;\)\)], "Input"], Cell[BoxData[ \(\(plotOptions = AbsoluteOptions[g];\)\)], "Input"], Cell[BoxData[ \(\(meshLines = True;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(graphicScaled[{x_, y_, z_}, opts_] := Module[{xRange, yRange, zRange}, \[IndentingNewLine]{xRange, yRange, zRange} = PlotRange\ /. \ opts; \[IndentingNewLine]{x*\((xRange[\([2]\)] - xRange[\([1]\)])\) + xRange[\([1]\)], \[IndentingNewLine]y*\((xRange[\([2]\)] - yRange[\([1]\)])\) + yRange[\([1]\)], \[IndentingNewLine]z*\((zRange[\([2]\)] - zRange[\([1]\)])\) + zRange[\([1]\)]\[IndentingNewLine]}\[IndentingNewLine]];\)\)], \ "Input"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(xRange\\)\\\" is similar to existing symbol \ \\\"\\!\\(Range\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(yRange\\)\\\" is similar to existing symbols \ \\!\\({Range, xRange}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(zRange\\)\\\" is similar to existing symbols \ \\!\\({Range, xRange, yRange}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(vectorNormalize[u_] := Module[{norm = N[Sqrt[u . u]]}, N[If[norm > 0, u/norm, u]]\ ]\)], "Input"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(norm\\)\\\" is similar to existing symbol \\\ \"\\!\\(Norm\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(vectorNormalize[{0, 1, 1}]\)], "Input"], Cell[BoxData[ \({0.`, 0.7071067811865475`, 0.7071067811865475`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FromDigits\)], "Input"], Cell[BoxData[ \(FromDigits\)], "Output"] }, Open ]], Cell[BoxData[ \(\(plotViewCenter = graphicScaled[ViewCenter /. \ plotOptions, plotOptions];\)\)], "Input"], Cell[BoxData[ \(\(plotViewPoint\ = graphicScaled[ViewCenter + ViewPoint\ /. \ plotOptions, plotOptions];\)\)], "Input"], Cell[BoxData[ \(\(plotViewVertical\ = ViewVertical\ /. \ plotOptions;\)\)], "Input"], Cell[BoxData[ \(\(plotImageSize\ = \ Round[\ ImageSize\ /. \ plotOptions\ ];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(plotBoxRatio = BoxRatios /. \ plotOptions\)], "Input"], Cell[BoxData[ \({1.`, 1.`, 1.`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(roughSphere = Max[plotBoxRatio*\((\(\((#[\([2]\)] - #[\([1]\)])\) &\)\ /@ \ \ \((PlotRange\ /. \ plotOptions)\))\)]/2. \)], "Input"], Cell[BoxData[ \(1.3125`\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((#[\([2]\)] - #[\([1]\)])\) &\)\ /@ \ \((PlotRange\ /. \ plotOptions)\)\)], "Input"], Cell[BoxData[ \({2.625`, 2.625`, 2.625`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(PlotViewVector = plotViewPoint/plotBoxRatio - plotViewCenter\)], "Input"], Cell[BoxData[ \({3.4125000000000005`, \(-6.3`\), 5.25`}\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(plotViewAngle = N[2*ArcTan[ roughSphere/ Sqrt[PlotViewVector . PlotViewVector]]\ ];\)\), "\[IndentingNewLine]", \(\(If[plotViewAngle > \ Pi*35/180. , \ plotViewAngle = \ Pi*35/180. ];\)\)}], "Input"], Cell[BoxData[ \(\(plotLightSources\ = {{{2.`, \(-1`\), 0.`}, RGBColor[1`, 1`, 1`]}, {\(-{2.`, 1. , 0.`}\), RGBColor[0.1`, 0.1`, .5`]}};\)\)], "Input"], Cell[BoxData[ \(\(plotLighting\ = \ Lighting /. \ plotOptions;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(plotAmbientLight = AmbientLight /. plotOptions; plotAmbientLight[\([0]\)] = List;\), "\[IndentingNewLine]", \(plotAmbientLight = Round[255*\((plotAmbientLight)\)]\)}], "Input"], Cell[BoxData[ \({0}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Initialize", "Section"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{\(InitializeGraphics[]\), ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{\({presentParams, \ presentParamsArray}\), ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{\(device\ = Null\), ";", " ", \( (*\ Checked\ against\ Null, \ so\ initialize\ *) \), "\n", " ", \(effect = Null\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", \(presentParams\ = \ NETNew["\"]\), ";", "\[IndentingNewLine]", \(presentParams@Windowed = True\), ";", "\[IndentingNewLine]", \(presentParams@SwapEffect = SwapEffect`Discard\), ";", "\[IndentingNewLine]", \(presentParams@EnableAutoDepthStencil = True\), ";", "\[IndentingNewLine]", \(presentParams@AutoDepthStencilFormat = DepthFormat`D16\), ";", "\n", "\n", \(presentParamsArray\ = \ MakeNETObject[{presentParams}, \ \ "\"]\), ";", "\[IndentingNewLine]", RowBox[{"device", " ", "=", " ", RowBox[{"NETNew", "[", RowBox[{ "\"\\"", ",", " ", "0", ",", " ", StyleBox[ RowBox[{"DeviceType`", StyleBox["Hardware", FontWeight->"Bold"]}]], ",", " ", "form", ",", " ", "CreateFlags`SoftwareVertexProcessing", ",", " ", "presentParamsArray"}], "]"}]}], ";", "\[IndentingNewLine]", \(If[ device =!= $Failed, \[IndentingNewLine]device@\(RenderState@ Lighting\) = plotLighting; \[IndentingNewLine]device@\(RenderState@ CullMode\) = Cull`None; \n\ \ device@\(RenderState@ZBufferEnable\) = True; \[IndentingNewLine]initProgress = 0; \[IndentingNewLine]Print["\"]; \ \n\tcustomVertexDeclaration = MakeNETObject[{\[IndentingNewLine]NETNew @@ \ Prepend[{0, 0, DeclarationType`Float4, DeclarationMethod`Default, DeclarationUsage`Position, 0}, "\\ "], NETNew @@ \ Prepend[{0, 16, DeclarationType`Float3, DeclarationMethod`Default, DeclarationUsage`Normal, 0}, "\\ "], NETNew @@ \ Prepend[{0, 28, DeclarationType`Float2, DeclarationMethod`Default, DeclarationUsage`TextureCoordinate, 0}, "\\ "], \[IndentingNewLine]NETNew @@ \ Prepend[{0, 36, DeclarationType`Float3, DeclarationMethod`Default, DeclarationUsage`TextureCoordinate, 1}, "\\ "], NETNew @@ \ Prepend[{0, 48, DeclarationType`Float3, DeclarationMethod`Default, DeclarationUsage`TextureCoordinate, 2}, "\\ "], \[IndentingNewLine]NETNew @@ \ Prepend[{0, 60, DeclarationType`Float3, DeclarationMethod`Default, DeclarationUsage`TextureCoordinate, 3}, "\\ "], \[IndentingNewLine]NETNew @@ \ Prepend[{255, 0, DeclarationType`Unused, 0, 0, 0}, "\\ "]\[IndentingNewLine]}, "\"]; \ \[IndentingNewLine]customVertexDeclarationSize = 72; \[IndentingNewLine]\n\t Print["\"]; \n\t customVertexDeclarationOnDevice = NETNew\ \ ["\", device, customVertexDeclaration]; \ \[IndentingNewLine]Print["\", customVertexDeclarationOnDevice]; \[IndentingNewLine]\ \[IndentingNewLine]Print["\"]; \ \[IndentingNewLine]vertexBuffer\ = \ NETNew["\", device, \((Length[points] + 1)\)* customVertexDeclarationSize, Usage`WriteOnly, 0, Pool`Default]; \ Print["\", vertexBuffer]; \[IndentingNewLine]AddEventHandler[ vertexBuffer@Created, \ OnCreateVertexBuffer]; \ \ \[IndentingNewLine]OnCreateVertexBuffer[vertexBuffer, \ Null]; \[IndentingNewLine]\[IndentingNewLine]Print["\<\ creating IndexBuffer for triangles\>"]; \ \[IndentingNewLine]triangleIndicesBuffer\ = \ NETNew["\", GetTypeObject[LoadNETType["\"]], Length[Flatten[triangles]], device, 0, Pool`Default]; \[IndentingNewLine]\ AddEventHandler[triangleIndicesBuffer@Created, \ OnCreatetriangleIndicesBuffer]; \ \ \[IndentingNewLine]OnCreatetriangleIndicesBuffer[triangleIndicesBuffer, \ Null]; \ \ \[IndentingNewLine]\[IndentingNewLine]Print["\", Date[]]; \[IndentingNewLine]meshTextureList = {\ TextureLoader`FromFile[device, "\"], TextureLoader`FromFile[ device, "\"]}; \[IndentingNewLine]\ \[IndentingNewLine]Print["\"]; \ \[IndentingNewLine]shaderFlags = BitOr[NETObjectToExpression[ShaderFlags`NotCloneable], NETObjectToExpression[ShaderFlags`NoPreShader]\ ]; \n\t effect = Effect`FromFile[ device, \ "\", Null, Null, Null, shaderFlags, Null, syntaxError\ ]; \ \[IndentingNewLine]\[IndentingNewLine]eyePositionInObjectSpace = NETNew["\"]; \ \[IndentingNewLine]Vector3size = Marshal`SizeOf[ eyePositionInObjectSpace]; \[IndentingNewLine]Vector3ptr \ = Marshal`AllocHGlobal[Vector3size]; \[IndentingNewLine]\n\t If[\(effect =!= $Failed\)\(,\)\[IndentingNewLine]\ \[IndentingNewLine]]; \[IndentingNewLine]\t Print["\", syntaxError, Date[]]; \[IndentingNewLine]\ Print["\"];\[IndentingNewLine], \ \[IndentingNewLine]Print["\"]; \[IndentingNewLine]device = Null;\[IndentingNewLine]]\), ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(form\\)\\\" is similar to existing symbol \\\ \"\\!\\(norm\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Create The vertex and index Buffers", "Section"], Cell[BoxData[ \(\(OnCreateLineIndicesBuffer[sender_, \ eventArgs_]\ := \[IndentingNewLine]Module[{stm}, \ \[IndentingNewLine]stm\ = \ sender@Lock[0, 0, 0]; \[IndentingNewLine]stm@ Write[\ MakeNETObject[ lines, "\"]]; \ \[IndentingNewLine]initProgress += Length[lines]; \[IndentingNewLine]sender@ Unlock[];\[IndentingNewLine]];\)\)], "Input"], Cell[BoxData[ \(\(OnCreatetriangleIndicesBuffer[sender_, \ eventArgs_]\ := \[IndentingNewLine]Module[{stm}, \ \[IndentingNewLine]stm\ = \ sender@Lock[0, 0, 0]; \[IndentingNewLine]stm@ Write[\ MakeNETObject[ Flatten[ triangles], "\"]]; \ \[IndentingNewLine]initProgress += Length[triangles]; \[IndentingNewLine]sender@ Unlock[];\[IndentingNewLine]];\)\)], "Input"], Cell[BoxData[ RowBox[{ RowBox[{\(OnCreateVertexBuffer[sender_, \ eventArgs_]\), " ", ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{\({stm}\), ",", "\[IndentingNewLine]", \( (*\ \(verts = N[Join[points, normals, \(\((\((Take[#, 2] - {minX, minY})\)/ range)\) &\) /@ points]];\)\ *) \), "\[IndentingNewLine]", RowBox[{\(stm\ = \ sender@Lock[0, 0, 0]\), ";", "\[IndentingNewLine]", \(Print["\"]\), ";", "\[IndentingNewLine]", RowBox[{"myVertexBufferUtils", "@", RowBox[{ StyleBox["OnCreateVertexBufferPTNTB", FontWeight->"Bold"], "[", \(stm, points, normals, tangents, biNormals, uvs\), "]"}]}], ";", "\[IndentingNewLine]", \(Print["\"]\), ";", "\[IndentingNewLine]", \(initProgress += Length[points]\), ";", "\[IndentingNewLine]", \(sender@Unlock[]\), ";"}]}], "\[IndentingNewLine]", \( (*\ \(initProgress += \ Length[points];\)\ *) \), "\[IndentingNewLine]", "]"}]}], ";"}]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Set up Matrices", "Section"], Cell[BoxData[ \(\(roty = 0. ;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(setupMatrices[] := Module[{}, \ \[IndentingNewLine]device@\(Transform@World\) = device@\(Transform@\(World@ Multiply[Matrix`RotationZ[roty], Matrix`Scaling @@ \ {1. , 1. , 0.8}]\)\); \[IndentingNewLine]device@\(Transform@ View\) = Matrix`LookAtRH[\[IndentingNewLine]NETNew @@ \ Join[{"\"}, N[plotViewPoint/ plotBoxRatio]], \ \[IndentingNewLine]NETNew @@ \ Join[{"\"}, N[plotViewCenter]], \ \[IndentingNewLine]NETNew @@ \ Join[{"\"}, N[plotViewVertical]]\[IndentingNewLine]]; \[IndentingNewLine]\ \[IndentingNewLine]device@\(Transform@Projection\) = Matrix`PerspectiveFovRH[plotViewAngle, \ N[\ plotImageSize[\([1]\)]/plotImageSize[\([2]\)]\ ], 1. , \ 100. \ ];\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(Transform\\)\\\" is similar to existing \ symbol \\\"\\!\\(ZTransform\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(World\\)\\\" is similar to existing symbol \ \\\"\\!\\(Word\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Rendering", "Section"], Cell[BoxData[ \(\(Render[]\ := \n\ \ Module[{}, \n\ \ \ If[ device\ === \ Null\ || \ device === \ $Failed\ || \ effect === Null\ , \n\ \ \ \ Return[]\n\ \ \ \ ]; \n\ \ \ device@ Clear\ [BitOr[NETObjectToExpression[ClearFlags`ZBuffer], NETObjectToExpression[ClearFlags`Target]], 0, \ 1. , 0]; \n\ \ \ device@BeginScene[]; \n\ \ \ device@ SetRenderState[RenderStates`AntialiasedLineEnable, False]; \n\ \ \ (*\ \(biasZBuffer = 0. ;\)\ *) \n\ \ \ \ device@ SetRenderState[RenderStates`DepthBias, \ 0. ]; \ \n\ \ \ setupMatrices[]; \n\ \ \ \n\ \ \ If[ effect =!= $Failed, \n\ \ \ \ (*\ set\ up\ the\ effect\ *) \n\ \ \ \ effect`Technique = \ "\"; \n\ \ \ \ (*\ sets\ all\ the\ variables\ for\ the\ effect\ \ *) \[IndentingNewLine] (*\ WorldViewProj*) \n\ \ \ \ effect@ SetValue[EffectHandle`FromString["\"], Matrix`Multiply[device@\(Transform@World\), Matrix`Multiply[device@\(Transform@View\), device@\(Transform@Projection\)]]]; \n\ \ \ \ world2obj = Matrix`Invert[ device@\(Transform@World\)]; \[IndentingNewLine] (*\ LightVector\ *) \n\ \ \ \ lightDirectionInObjectSpace = Vector3`Normalize[ Vector3`TransformNormal[\ NETNew @@ \ Prepend[\(-{\(-2. \), 1. , 0. }\), "\"]\ , world2obj]]; \n\ \ \ \ Marshal`StructureToPtr[ lightDirectionInObjectSpace, Vector3ptr, True]; \n\ \ \ \ effect@ SetValue[EffectHandle`FromString["\"], Vector3ptr, Vector3size]; \[IndentingNewLine] (*\ EyePosition\ *) \n\ \ \ \ invertView = Matrix`Invert[ device@\(Transform@ View\)]; \n\ \ \ \ eyePositionInWorldSpace = NETNew @@ \ Prepend[{invertView@M41, invertView@M42, invertView@ M43}, "\"]; \n\ \ \ \ \ eyePositionInObjectSpace = Vector3`TransformCoordinate[eyePositionInWorldSpace, world2obj]; \n\ \ \ \ Marshal`StructureToPtr[ eyePositionInObjectSpace, Vector3ptr, True]; \[IndentingNewLine]effect@ SetValue[EffectHandle`FromString["\"], Vector3ptr, Vector3size]; effect@SetValue[ EffectHandle`FromString["\"], .5]; \ \[IndentingNewLine] (*\ DiffuseMap\ *) \n\ \ \ \ effect@ SetValue[EffectHandle`FromString["\"], meshTextureList[\([1]\)]]; effect@SetValue[EffectHandle`FromString["\"], meshTextureList[\([2]\)]]; \[IndentingNewLine]\ \[IndentingNewLine] (*\ run\ as\ many\ passes\ as\ necessary*) \n\ \ \ \ passes\ = \ effect@Begin[0]; \n\ \ \ \ For[pass = 0, \ pass < passes, \(\(pass++\);\), \n\ \ \ \ \ effect@ BeginPass[pass]; \[IndentingNewLine] (*\ set\ the\ vertex\ stream\ *) \n\ \ \ \ \ device@ VertexDeclaration = customVertexDeclarationOnDevice; \n\ \ \ \ \ device@ SetStreamSource[0, vertexBuffer, 0, customVertexDeclarationSize]; \n\ \ \ \ \ device@Indices = triangleIndicesBuffer; \ \[IndentingNewLine] (*\ draw\ the\ triangles\ *) \n\ \ \ \ \ device@ DrawIndexedPrimitives[PrimitiveType`TriangleList, 0, minIndexTriangles, numVerticesTriangles, 0, Length[triangles]]; \n\ \ \ \ \ effect@ EndPass[];\n\ \ \ \ \ ];\n\ \ \ \ ]; \ (*\ effect\ =!= \ $Failed\ *) \n\ \ \ \ \ \ device@ EndScene[]; \n\ \ \ \ device@Present[]; \[IndentingNewLine] (*\ output\ something\ for\ our\ sake\ *) \n\ \ \ "\"\n\ \ \ \ ];\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Handling Events", "Section"], Cell[BoxData[ \(OnPaint[__]\ := \ Render[]\)], "Input"], Cell[BoxData[ \(OnKeyPress[sender_, \ eventArgs_]\ := \[IndentingNewLine]If[ eventArgs@KeyChar\ \[Equal] \ NETObjectToExpression[Keys`Escape], \ form@Close[]; device = Null;]\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Main", "Section"], Cell[BoxData[ \(\(form\ = \ NETNew["\"];\)\)], "Input"], Cell[BoxData[ \(\(form@ClientSize = NETNew["\", \ plotImageSize[\([1]\)], plotImageSize[\([2]\)]\ ];\)\)], "Input"], Cell[BoxData[ \(\(form@Text\ = \ "\";\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(InitializeGraphics[];\)\)], "Input"], Cell[BoxData[ \("customVertexDeclaration"\)], "Print"], Cell[BoxData[ \("customVertexDeclarationOnDevice"\)], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"customVertexDeclarationOnDevice=\"\>", "\[InvisibleSpace]", InterpretationBox[\(\[LeftGuillemet] NETObject[ Microsoft . DirectX . Direct3D . VertexDeclaration] \[RightGuillemet]\), NETLink`Objects`NETObject$26345971357057025]}], SequenceForm[ "customVertexDeclarationOnDevice=", NETLink`Objects`NETObject$26345971357057025], Editable->False]], "Print"], Cell[BoxData[ \("creating vertexBuffer for textures"\)], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"vertexBuffer=\"\>", "\[InvisibleSpace]", InterpretationBox[\(\[LeftGuillemet] NETObject[ Microsoft . DirectX . Direct3D . VertexBuffer] \[RightGuillemet]\), NETLink`Objects`NETObject$56971526645219329]}], SequenceForm[ "vertexBuffer=", NETLink`Objects`NETObject$56971526645219329], Editable->False]], "Print"], Cell[BoxData[ \("Calling OnCreateVertexBuffer"\)], "Print"], Cell[BoxData[ \("Returned From OnCreateVertexBuffer"\)], "Print"], Cell[BoxData[ \("creating IndexBuffer for triangles"\)], "Print"], Cell[BoxData[ InterpretationBox[\("Loading the textures"\[InvisibleSpace]{2005, 10, 19, 7, 31, 24.03125`9.133351285180765}\), SequenceForm[ "Loading the textures", {2005, 10, 19, 7, 31, 24.03125`9.133351285180765}], Editable->False]], "Print"], Cell[BoxData[ \("Compiling the shader and creating the effect"\)], "Print"], Cell[BoxData[ InterpretationBox[\("Syntax error or \ Warning="\[InvisibleSpace]"C:\\Documents and Settings\\Luc\\Desktop\\Directx \ Sample in Mathematica\\Specular bump \ mapping\\specularBumpVertexPixelShader.fx(165): warning X4707: texcoord \ inputs used directly (that is, other than sampling from textures) in shader \ body in ps_1_1 are always clamped from 0 to 1\nC:\\Documents and \ Settings\\Luc\\Desktop\\Directx Sample in Mathematica\\Specular bump \ mapping\\specularBumpVertexPixelShader.fx(110): warning X4707: texcoord \ inputs used directly (that is, other than sampling from textures) in shader \ body in ps_1_1 are always clamped from 0 to 1\n"\[InvisibleSpace]{2005, 10, 19, 7, 31, 24.296875`9.138125343078208}\), SequenceForm[ "Syntax error or Warning=", "C:\\Documents and Settings\\Luc\\Desktop\\Directx Sample in \ Mathematica\\Specular bump mapping\\specularBumpVertexPixelShader.fx(165): \ warning X4707: texcoord inputs used directly (that is, other than sampling \ from textures) in shader body in ps_1_1 are always clamped from 0 to 1\n\ C:\\Documents and Settings\\Luc\\Desktop\\Directx Sample in \ Mathematica\\Specular bump mapping\\specularBumpVertexPixelShader.fx(110): \ warning X4707: texcoord inputs used directly (that is, other than sampling \ from textures) in shader body in ps_1_1 are always clamped from 0 to 1\n", { 2005, 10, 19, 7, 31, 24.296875`9.138125343078208}], Editable->False]], "Print"], Cell[BoxData[ \("Init done."\)], "Print"] }, Open ]], Cell[BoxData[ \(\(ShowNETWindow[form];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(AddEventHandler[form@KeyPress, \ OnKeyPress]\)], "Input"], Cell[BoxData[ InterpretationBox[\(\[LeftGuillemet] NETObject[ System . Windows . Forms . KeyPressEventHandler] \[RightGuillemet]\), NETLink`Objects`NETObject$1134881941749761]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(AddEventHandler[form@Paint, \ OnPaint]\)], "Input"], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(Paint\\)\\\" is similar to existing symbols \ \\!\\({Point, Print}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ InterpretationBox[\(\[LeftGuillemet] NETObject[ System . Windows . Forms . PaintEventHandler] \[RightGuillemet]\), NETLink`Objects`NETObject$1134883955015681]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Rotation", "Section"], Cell[BoxData[ \(roty += Pi/64. ; Render[];\)], "Input"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1600}, {0, 1113}}, AutoGeneratedPackage->None, WindowSize->{1225, 1055}, WindowMargins->{{Automatic, 0}, {4, Automatic}}, ShowSelection->True, Magnification->1 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 96, 3, 150, "Title"], Cell[CellGroupData[{ Cell[1897, 60, 34, 0, 38, "Subsection"], Cell[1934, 62, 198, 5, 30, "Input"], Cell[2135, 69, 472, 10, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2644, 84, 28, 0, 73, "Section"], Cell[2675, 86, 44, 1, 30, "Input"], Cell[2722, 89, 275, 6, 90, "Input"], Cell[3000, 97, 42, 1, 30, "Input"], Cell[3045, 100, 148, 3, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3230, 108, 42, 0, 73, "Section"], Cell[3275, 110, 223, 3, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3535, 118, 44, 0, 73, "Section"], Cell[3582, 120, 121, 3, 33, "Text"], Cell[3706, 125, 2890, 52, 730, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6633, 182, 68, 0, 73, "Section"], Cell[6704, 184, 79, 1, 30, "Input"], Cell[CellGroupData[{ Cell[6808, 189, 108, 2, 30, "Input"], Cell[6919, 193, 69, 1, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7025, 199, 78, 1, 30, "Input"], Cell[7106, 202, 66, 1, 29, "Output"] }, Open ]], Cell[7187, 206, 83, 1, 30, "Input"], Cell[CellGroupData[{ Cell[7295, 211, 86, 1, 30, "Input"], Cell[7384, 214, 169, 3, 29, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7602, 223, 35, 0, 73, "Section"], Cell[7640, 225, 878, 17, 210, "Input"], Cell[8521, 244, 111, 2, 30, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[8669, 251, 59, 0, 73, "Section"], Cell[CellGroupData[{ Cell[8753, 255, 49, 0, 38, "Subsection"], Cell[8805, 257, 48, 1, 30, "Input"], Cell[8856, 260, 811, 15, 210, "Input"], Cell[9670, 277, 499, 10, 110, "Input"], Cell[CellGroupData[{ Cell[10194, 291, 124, 3, 30, "Input"], Cell[10321, 296, 63, 1, 25, "Print"] }, Open ]], Cell[10399, 300, 234, 4, 30, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[10670, 309, 84, 1, 38, "Subsection"], Cell[10757, 312, 612, 11, 170, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[11418, 329, 49, 0, 73, "Section"], Cell[11470, 331, 81, 1, 30, "Input"], Cell[11554, 334, 119, 2, 30, "Input"], Cell[11676, 338, 70, 1, 30, "Input"], Cell[11749, 341, 54, 1, 30, "Input"], Cell[CellGroupData[{ Cell[11828, 346, 617, 12, 150, "Input"], Cell[12448, 360, 359, 5, 22, "Message"], Cell[12810, 367, 360, 5, 22, "Message"], Cell[13173, 374, 368, 5, 22, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[13578, 384, 133, 3, 30, "Input"], Cell[13714, 389, 356, 5, 22, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[14107, 399, 59, 1, 30, "Input"], Cell[14169, 402, 81, 1, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14287, 408, 43, 1, 30, "Input"], Cell[14333, 411, 44, 1, 29, "Output"] }, Open ]], Cell[14392, 415, 119, 2, 30, "Input"], Cell[14514, 419, 145, 3, 30, "Input"], Cell[14662, 424, 90, 1, 30, "Input"], Cell[14755, 427, 106, 2, 30, "Input"], Cell[CellGroupData[{ Cell[14886, 433, 74, 1, 30, "Input"], Cell[14963, 436, 49, 1, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15049, 442, 161, 3, 30, "Input"], Cell[15213, 447, 41, 1, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15291, 453, 121, 2, 30, "Input"], Cell[15415, 457, 58, 1, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15510, 463, 93, 1, 30, "Input"], Cell[15606, 466, 73, 1, 29, "Output"] }, Open ]], Cell[15694, 470, 296, 7, 50, "Input"], Cell[15993, 479, 182, 3, 30, "Input"], Cell[16178, 484, 82, 1, 30, "Input"], Cell[CellGroupData[{ Cell[16285, 489, 207, 3, 50, "Input"], Cell[16495, 494, 37, 1, 29, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[16581, 501, 29, 0, 73, "Section"], Cell[CellGroupData[{ Cell[16635, 505, 7628, 132, 1450, "Input"], Cell[24266, 639, 356, 5, 22, "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[24671, 650, 54, 0, 73, "Section"], Cell[24728, 652, 415, 7, 150, "Input"], Cell[25146, 661, 468, 9, 150, "Input"], Cell[25617, 672, 1328, 27, 230, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[26982, 704, 34, 0, 73, "Section"], Cell[27019, 706, 48, 1, 30, "Input"], Cell[CellGroupData[{ Cell[27092, 711, 1051, 19, 210, "Input"], Cell[28146, 732, 369, 6, 22, "Message"], Cell[28518, 740, 357, 5, 22, "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[28924, 751, 28, 0, 73, "Section"], Cell[28955, 753, 4281, 75, 1030, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[33273, 833, 34, 0, 73, "Section"], Cell[33310, 835, 60, 1, 30, "Input"], Cell[33373, 838, 210, 3, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[33620, 846, 23, 0, 73, "Section"], Cell[33646, 848, 88, 1, 30, "Input"], Cell[33737, 851, 161, 3, 30, "Input"], Cell[33901, 856, 84, 1, 30, "Input"], Cell[CellGroupData[{ Cell[34010, 861, 58, 1, 30, "Input"], Cell[34071, 864, 58, 1, 25, "Print"], Cell[34132, 867, 66, 1, 25, "Print"], Cell[34201, 870, 509, 12, 25, "Print"], Cell[34713, 884, 69, 1, 25, "Print"], Cell[34785, 887, 448, 10, 25, "Print"], Cell[35236, 899, 63, 1, 25, "Print"], Cell[35302, 902, 69, 1, 25, "Print"], Cell[35374, 905, 69, 1, 25, "Print"], Cell[35446, 908, 286, 6, 25, "Print"], Cell[35735, 916, 79, 1, 25, "Print"], Cell[35817, 919, 1488, 23, 234, "Print"], Cell[37308, 944, 45, 1, 25, "Print"] }, Open ]], Cell[37368, 948, 57, 1, 30, "Input"], Cell[CellGroupData[{ Cell[37450, 953, 77, 1, 30, "Input"], Cell[37530, 956, 230, 5, 29, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[37797, 966, 71, 1, 30, "Input"], Cell[37871, 969, 358, 5, 22, "Message"], Cell[38232, 976, 214, 4, 29, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[38495, 986, 27, 0, 73, "Section"], Cell[38525, 988, 59, 1, 30, "Input"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)