Archived

This topic is now archived and is closed to further replies.

Progressive Meshes

This topic is 5649 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi I''m trying to write a bit of code to generate a progressive mesh system, and have come across a couple of strange, er.. things: 1) When welding the mesh using D3DXWeldVertices(), passing NULL as the first perameter for the adjacency information [in] works, but giving it a pointer to adjacancy information generated by the D3DXCreateMeshFromX() method generates a run-time error. Any ideas? 2) More importantly, after creating a progressive mesh, I try to get the minimum and maximum vertex values from it, but this again generates a run-time error (Read of Address 00000000). Obviously without this information it is impossible to generate the progressive meshes which follow. I have looked at the SDK sample for this, but can see no difference in my implementation to it. Has anyone come across this, or any ideas? Thanks for the help. Steven Hobbs

Share this post


Link to post
Share on other sites
you can''t give it a pointer directly to the D3DXBuffer that D3DXCreateMeshFromX() returns. You have to request a pointer into the buffer''s data, and cast that as a DWORD* in order to really get to the Adjacency information. Can''t tell if this is really the problem without the code, but sounds like the most likely.

HRESULT hr = D3DXLoadMeshFromX(szFilename, D3DXMESH_MANAGED, lpD3DD, &lpAdjBuf, &lpMatBuf, &dwNumMaterials, &lpMesh);
DWORD *pAdjacency = (DWORD *)lpAdjBuf->GetBufferPointer();

something similar to that. hope that fixes your first problem

have no idea about your 2nd more important question (lol doesn''t that figure?) i have no experience trying to use the progressive mesh''s... just the adjacency information (i use it to optimize my mesh''s)

Share this post


Link to post
Share on other sites
Yup, have done that. Tried it by the way you suggested, and the way that the DX samples do it by just retrieving the buffer pointer in the function call, but I don''t think it''s too much of a problem. I''m just wondering if that''s the reason that the creation of the progressive mesh is failing, but I have doubts.

Actually, tell a lie. The actual call to create the progressive mesh itself succeeds, and the object itself is not NULL after the call, but it''s just the calls to GetMinVertices() and GetMaxVertices() which cause a "read of address 00000000" error. It''s really strange.

If it helps, I am doing this in an editor using Borland Builder 5, with the Borland DX dlls, but this is the only thing I have found wrong with them. I will try it in my game engine after, but would really like this working.

Share this post


Link to post
Share on other sites
I tried using borland and had a few problems with the d3dx8.dll that i downloaded. I have a version that works fine and for 8.1. e-mail me if you would like it.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites