Jump to content
Xtreme .Net Talk

Poncho843

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Poncho843

  1. Excellent!! Does that mean i have to track down and download 9.0b now!!! Outrageous :-\
  2. Pentium Guy, I haven't got the code ready for the world yet, but if you're interested, here is the most insightful document i have read on animation and meshes with directx 9 - didn't use any of the code, but the theory makes everything clear. d3dx_skinnedmesh.pdf
  3. I discovered the exact problem behind the distorted mesh when animating. It didn't convert it to a single mesh, so every bone had it's own mesh and as a result were disjoint, no vertex blending or anything vaguely skinmesh'y about it. How to fix it, i don't know, but i've made my milkshape importer manipulate the vertices and bones itself without ConvertToIndexedBlendedMesh or any reference to AnimationController or Hierarchy. It's pretty specific code to milkshape, but it works a treat. Will tidy up, comment the code and post it if anyone is having the same problem.
  4. I don't see why i should have to write half my code in another language when it should work equally well in both. Documentation says it should work but it doesn't. Ported several examples from C# to VB without any success. DirectX has not been well implemented in VB.NET and if they only intended to do half a job then they shouldn't have bothered at all. Gripe over. Having said all that, I've got around every problem i have ever had with directx by rewriting all the relevant functions and structures myself, importing mesh and animation data straight from milkshape3d files and i have a very nice frames per second rate too. I am now very happy. Thank you all.
  5. Everywhere you turn theres a damn wall. Couldn't get X files to work so i wrote my own importer, and now i can't get them into an AnimationAllocation either! Bugger it, the only thing left is to change the mesh's vertex buffer manually each frame of animation, didn't want to but it's the only thing left to do Damn you microsoft!! Time to get my ZX Spectrum back out, at least that was straight forward to program in
  6. Hi guys, Hopefully this will be a quick question, but alas i cannot find anything on the web to help me (probably so simple it doesn't need documenting). Mesh.GenerateAdjacency returns Integer(), but AllocateHierarchy.CreateMeshContainer needs it in the form of a GraphicsStream. Is there a way to convert between the two formats??? Cheers
  7. Don't worry about it. Missed a factor of 3 out on numVertices. You can spend 6 hours looking at it and not notice, and the second you post it to a forum it comes to you. Sorry guys
  8. Hi all, was wondering if any of you guys have had this problem before and know of a solution. I keep losing my device and i don't know where it's going. Here is the problem code: Public Function createMesh(ByVal D3DDev As Device, ByRef mesh As Mesh, ByRef meshmaterials() As Material, ByRef meshtextures() As Texture) As Boolean Dim i As Integer, j As Integer, v As ms3d_vertex_t mesh = New Mesh(nNumTriangles, nNumVertices, MeshFlags.Managed, CustomVertex.PositionNormalTextured.Format, D3DDev) Dim vb As VertexBuffer = mesh.VertexBuffer Dim data As GraphicsStream = vb.Lock(0, 0, LockFlags.None) ' For i = 0 To nNumVertices - 1 ' v = vertices(i) ' data.Write(new CustomVertex.PositionNormalTextured(new Vector3(v.vertex(0),v.vertex(1),v.vertex(2)), ' data.Write(New CustomVertex.PositionColored(v.vertex(0), v.vertex(1), v.vertex(2), &HFF)) ' Debug.WriteLine(v.vertex(0) & ":" & v.vertex(1) & ":" & v.vertex(2)) ' Next Dim t As ms3d_triangle_t For i = 0 To nNumTriangles - 1 t = triangles(i) For j = 0 To 2 v = vertices(CInt(t.vertexIndices(j).ToString)) Dim pos As Vector3 = New Vector3(v.vertex(0), v.vertex(1), v.vertex(2)) Dim nor As Vector3 = New Vector3(t.vertexNormals(j, 0), t.vertexNormals(j, 1), t.vertexNormals(j, 2)) data.Write(New CustomVertex.PositionNormalTextured(pos, nor, t.s(j), t.t(j))) Next Next vb.Unlock() Dim ib As IndexBuffer = mesh.IndexBuffer Dim indices(nNumTriangles * 3 - 1) As Short For i = 0 To nNumTriangles - 1 ' indices(i * 3) = CShort(triangles(i).vertexIndices(0).ToString) ' indices(i * 3 + 1) = CShort(triangles(i).vertexIndices(1).ToString) ' indices(i * 3 + 2) = CShort(triangles(i).vertexIndices(2).ToString) indices(i * 3) = CShort(i * 3) indices(i * 3 + 1) = CShort(i * 3 + 1) indices(i * 3 + 2) = CShort(i * 3 + 2) Next ib.SetData(indices, 0, LockFlags.None) 'mesh.ComputeNormals() ReDim meshmaterials(nNumMaterials - 1) ReDim meshtextures(nNumMaterials - 1) For i = 0 To nNumMaterials - 1 meshmaterials(i).Ambient = Color.FromArgb(materials(i).ambient(3), materials(i).ambient(0), materials(i).ambient(1), materials(i).ambient(2)) meshmaterials(i).Diffuse = Color.FromArgb(materials(i).diffuse(3), materials(i).diffuse(0), materials(i).diffuse(1), materials(i).diffuse(2)) meshmaterials(i).Emissive = Color.FromArgb(materials(i).emissive(3), materials(i).emissive(0), materials(i).emissive(1), materials(i).emissive(2)) meshmaterials(i).Specular = Color.FromArgb(materials(i).specular(3), materials(i).specular(0), materials(i).specular(1), materials(i).specular(2)) meshtextures(i) = TextureLoader.FromFile(D3DDev, materials(i).texture) Next End Function on the last line meshtextures(i) = TextureLoader....... i get the error both the materials object and the device object appear ok in the watch pane, so i am bewildered about what is null referenced. If i take this line out the error occurs on the next reference to D3DDev further in the app, but if i take the reference to my createMesh function out completely, i don't The problem started when i changed the mesh vertex format from Position to PositionNormalTextured and associated code changes (commented out above), but that was the only change made before the errors started. Any ideas would be greatly received.
  9. I don't have 9.0a which has always been a problem to me when looking for examples. Looking into getting the December 2004 release but not convinced that will make any difference so i have downloaded it but not installed it yet. Tempted to go back to 8.1!!!!! I've have had some mini-progress though. Exported my meshes from MilkShape using two different algorithms - first one the mesh is fine but no animation, second one the animation is fine but the mesh is messed up, so i'm going to have a look and see if i can combine the two from the ascii files - very odd, but a lot further that i got before. Will post the changes when/if i fine them
  10. Cheers Pentium Guy, looked at that site before, and like you said is completely incompatible with any recent release of DX9. Was hoping there was a way without reverting to an older version of DX9 but if the only way forward is backward then so be it. I believe the phrase rhymes with clucking bell!! :-\
  11. Hello all, i am desperate for someone to help me. I have downloaded every piece of source code i can find and all have the same results - when i try to create a skinned mesh and load the animation, with tiny.x the whole body moves rigidly as if it were just 1 bone, and my own creations (exported from milkshape) appear as the default pose with no animation at all. The annoying thing is when the meshes are loaded into mesh viewer the animations are perfect. Is there something obvious that i am missing??? Some guy on another thread, i can't remember which now, converted the skinnedmesh c++ code into vb.net and i used that to no avail - i have attached the whole project, if someone could please take a look at see if there are any obvious problems with it. I have vb visual studio.net 2003 and directx 9 october 2004 release (which i haven't got anything to work with yet) I know i'm asking a lot, and i do apologise, but i am at my wits end. Thank you all very much in advance Basic_D3D9_VB.zip
  12. Hello there, was wondering if anyone could help me. I have some knowledge of DX8 in VB6, recently upgraded to VB.NET so got myself DX9 summer 2004 release. I am trying to load in skinned meshes from .x files, but the docs are useless and the few examples i find on the net don't work. For example, all say to use "dataFile = dxFile.GetNextDataObject()", but then i get the error "'GetNextDataObject' is not a member of 'Microsoft.DirectX.Direct3D.XFile'". Does anybody have any examples of code i could use to load .x files in, know any websites with working examples, or could fix some code with me??? Source code i've downloaded and trying to make can be found at http://robydx.altervista.org/DirectX9/Direct3D9Less34.htm Thanks in advance Steve
×
×
  • Create New...