Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / Game Design & Programming / confusion with Physique Exporting Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
jimgoer

January 18, 2005, 12:18 PM

Hey, new to the site and also new to using Physique for animation exporting.
Just a couple of question, to clear things up.

First i have already written a character exporter using max's triangle strips, (running 3D Max 6) And all objects rendering fine in my OpenGL program (with texture and normals all working great), now i have started to work on animation but im getting confuesed on a few issues since this is my first time doing anything like this.

my first problem is when i get the Physique vertex count, the number is much less then the number of vertices in the model, now im assuming that this is correct because its only giving me the vertices that are affected by the bones, am i correct with this assumption?

the second problem is getting the bone(Translation matrix for each bone). at the same time as getting the weights for the bones i call GetNodeTM(T) to get the transformation matrix. heres a bit of the code:

  1.  
  2. // Get Bone 1 and Bone 2
  3. for (n = 0; n < RigidBlended_vtx->GetNumberNodes(); n++){
  4.                                
  5. INode* Bone =  RigidBlended_vtx->GetNode(n);
  6. OffsetVector = RigidBlended_vtx->GetOffsetVector(n);   
  7.        
  8. // get the weight of this bone
  9. Weight[n] = RigidBlended_vtx->GetWeight(n);
  10.                                                                        
  11. /////////////////////////////////////////////////
  12. pdebug = fopen("D:\Bone.txt", "a");
  13. fprintf(pdebug, "Bone weight%d: %fn", n, Weight[n]);
  14. fclose( pdebug);
  15.                                        
  16. // Get the Bones TMatrix at the same time (T is the Key Frame time)
  17. BoneTM[n] = Bone->GetNodeTM(T) * Inverse(Bone->GetParentTM(T));
  18.                                        
  19. // write data to export file......
  20. }                              
  21.        
  22.  


Now, is this code correct? the data i gets doesn't seem to be right, here is what i get:
  1.  
  2. ----- Number Key Frames: 100 -----
  3. ----- Number AKey Frames: 0 -----
  4. ----- Time Range: 0.000000 -----
  5. ----- Bone Info----------------
  6. -------------------------------
  7. -------------------------------
  8. ----- Number of Vertices: 128 -----
  9. ----- Bone Influences: 1 -----
  10. Bone weight: 1.000000
  11. Bone TransM - x:1.000000, y:0.000000, z:0.000000
  12. Bone TransM - x:0.000000, y:1.000000, z:0.000173
  13. Bone TransM - x:0.000000, y:-0.000173, z:1.000000
  14. ----- Bone Influences: 1 -----
  15. Bone weight: 1.000000
  16. Bone TransM - x:1.000000, y:0.000000, z:0.000000
  17. Bone TransM - x:0.000000, y:1.000000, z:0.000173
  18. Bone TransM - x:0.000000, y:-0.000173, z:1.000000
  19. ----- Bone Influences: 1 -----
  20. Bone weight: 1.000000
  21. Bone TransM - x:1.000000, y:0.000000, z:0.000000
  22. Bone TransM - x:0.000000, y:1.000000, z:0.000173
  23. Bone TransM - x:0.000000, y:-0.000173, z:1.000000
  24. ----- Bone Influences: 1 -----
  25. Bone weight: 1.000000
  26. Bone TransM - x:1.000000, y:0.000000, z:0.000000
  27. Bone TransM - x:0.000000, y:1.000000, z:0.000173
  28. Bone TransM - x:0.000000, y:-0.000173, z:1.000000
  29. ----- Bone Influences: 2 -----
  30. Bone weight0: 0.500000
  31. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  32. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  33. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  34. Bone weight1: 0.500000
  35. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  36. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  37. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  38. ----- Bone Influences: 2 -----
  39. Bone weight0: 0.500000
  40. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  41. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  42. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  43. Bone weight1: 0.500000
  44. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  45. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  46. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  47. ----- Bone Influences: 2 -----
  48. Bone weight0: 0.050000
  49. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  50. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  51. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  52. Bone weight1: 0.950000
  53. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  54. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  55. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  56. ----- Bone Influences: 2 -----
  57. Bone weight0: 0.250000
  58. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  59. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  60. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  61. Bone weight1: 0.750000
  62. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  63. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  64. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  65. ----- Bone Influences: 2 -----
  66. Bone weight0: 0.250000
  67. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  68. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  69. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  70. Bone weight1: 0.750000
  71. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  72. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  73. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  74. ----- Bone Influences: 2 -----
  75. Bone weight0: 0.250000
  76. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  77. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000033
  78. Bone TransM - x3:0.000000, y3:-0.000033, z3:1.000000
  79. Bone weight1: 0.750000
  80. Bone TransM - x1:1.000000, y1:0.000000, z1:0.000000
  81. Bone TransM - x2:0.000000, y2:1.000000, z2:0.000173
  82. Bone TransM - x3:0.000000, y3:-0.000173, z3:1.000000
  83.  


Notice how the data seems repetitive with different bones, each chunk is a vertex (chunk starts with --Bone Influences--), is this still correct? (i have removed alot of the data, but its the same, just different chucks put together)

I have a couple more questions but this one is getting to long, ill ask them after these have been answered, thanks for all your help.

 
This thread contains 1 message.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.