I grabbed the latest updates which notes they work with June / August 2005 SDKs.
I'm running the Visual C# Express Beta 2 while clawing my way through these chapters using the DirectX 9 August 2005 SDK.
In Chapter 7, the first stop was changing the Simplifying Existing Meshes:
From:// Clean our main meshMesh tempMesh = Mesh.Clean(mesh, adj, adj);To:// Clean our main meshMesh tempMesh = Mesh.Clean(CleanType.Simplification, mesh, adj, adj);
However, the next stop I'm stuck at:
// Get our new simplified meshsimplifiedMesh = Mesh.Simplify(mesh, adj, null, 1, MeshFlags.SimplifyVertex);It returns the following error:System.AccessViolationException was unhandled Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Source="Microsoft.DirectX.Direct3DX" StackTrace: at D3DXSimplifyMesh(ID3DXMesh* , UInt32* , _D3DXATTRIBUTEWEIGHTS* , Single* , UInt32 , UInt32 , ID3DXMesh** ) at Microsoft.DirectX.Direct3D.Mesh.SimplifyMeshInternal(Mesh mesh, IntPtr adjacency, AttributeWeights& vertexAttributeWeights, IntPtr vertexWeights, Int32 minValue, MeshFlags options) at Microsoft.DirectX.Direct3D.Mesh.Simplify(Mesh mesh, GraphicsStream adjacency, GraphicsStream vertexWeights, Int32 minValue, MeshFlags options) at Chapter7Code.Form1.LoadMesh(String file) in C:\Program Files\Sams Publishing\MDXKickStart\C# Code\Chapter 7\SimplifyMesh\Form1.cs:line 94 at Chapter7Code.Form1.InitializeGraphics() in C:\Program Files\Sams Publishing\MDXKickStart\C# Code\Chapter 7\SimplifyMesh\Form1.cs:line 58 at Chapter7Code.Form1.Main() in C:\Program Files\Sams Publishing\MDXKickStart\C# Code\Chapter 7\SimplifyMesh\Form1.cs:line 217 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
I understand the concept behind it, just looking for a working solution. As I read further into the book, it looks like maybe welding vertices or patching meshes might be more ideal. Just looking to be well rounded when learning this stuff.
[Edited by - cider123 on October 3, 2005 12:01:38 PM]