Generic_Item.mesh.ascii structure doubt

View previous topic View next topic Go down

Generic_Item.mesh.ascii structure doubt

Post by tehjackie8834 on Fri Sep 19, 2014 9:41 am

I am trying to understand how a mesh information is stored, so that i can load them in Matlab.
i had opened Generic_Item.mesh.ascii in notepad, and i am confused for the vertices structure arrangement part.

this is how it looks like:

252 # bones        
...
12 # meshes
23_Material16_1_0_0
1 # uv layers
7 # textures
...
1156 # vertices
-0.014241900295 1.40578997135 -0.106535002589
-0.163853883743 0.504440426826 -0.847743153572
255 255 255 255
0.770659983158 -0.81543302536
2 3 4 0
0.313726007938 0.552941024303 0.133332997561 0

-0.0189270991832 1.37207996845 -0.132636994123
-0.00799584947526 0.603167831898 -0.797540187836
255 255 255 255
0.768989980221 -0.800354957581
2 3 4 0
0.564706087112 0.388235092163 0.0470588095486 0


...
1873 # faces
0 2 1
2 3 1
3 2 4
4 5 3
5 4 6
...

----------------------------------------------------------------------------------------------------------------------------------------

for the vertices part, it means there are 1156 vertices, and there are actually 6936 lines of information. i observed that the format is repeating for every 6 rows,
so each 6 rows of inumbers contains the xyz coordinate of 1 vertices.

according to my understanding, for the faces part, 0 2 1 would mean this face is form by vertex-0, vertex-2 and vertex-1.
Here comes my doubt : there are 6 rows of number, what are they represents?

-0.014241900295 1.40578997135 -0.106535002589                       % 3 numbers should be the x y z coordinate
-0.163853883743 0.504440426826 -0.847743153572
255 255 255 255                                                                                % what about 4 integer? 255 seems like brightness?
0.770659983158 -0.81543302536                                                     % and 2 numbers?
2 3 4 0
0.313726007938 0.552941024303 0.133332997561 0                     % this is 4 number, where the 4th number always near 0


Can someone explain the information structure of this vertices, or guide me to a place that i can find answer?
Thanks in advance

tehjackie8834
XNALara guest
XNALara guest

Male Сообщения : 1

Back to top Go down

XNA araL (old) .mesh.ascii file format description

Post by XNAaraL on Thu Sep 25, 2014 8:55 am

Membuat Nasib Baik Selalu
study
Sure, I can guide you to a place that you can find the answer.
code: [You must be registered and logged in to see this link.]
documentation: [You must be registered and logged in to see this link.]

Basketball
The format is NOT EVER repeating for every 6 rows. It is dependency of the count of UV-layers and  the fact if the model has a armature ... or not.
Each part of rows contains the informations about 1 vertex, that has certain attributes. One of which is its position Wink
Idea
Code:

-0.014241900295 1.40578997135 -0.106535002589                  % the x y z coordinates for the vertex position
 XNA Uses a right-handed coordinate system.
    Forward is Z, backward is -Z. Forward points towards the camera (out of the screen).
    Right is +X, left is -X. Right points to the right-side of the screen.
    Up is +Y, down is -Y. Up points to the top of the screen.

-0.163853883743 0.504440426826 -0.847743153572                %  the x y z coordinate for the vertex normal of an approximated curved surface at the location of the vertex

255 255 255 255                                                                      % RGBA (range from 0 to 255) for the vertex colors

0.770659983158 0.81543302536                                              % UV coordinates for the first UV-layer ... range from 0.0 to 1.0 ... your model data are corrupted

0.770659983158 0.81543302536                                              % UV coordinates for the second UV-layer (if the model has more then 1 layer

2 3 4 0                                                                                    % bone indices (if the model has bones  )

0.313726007938 0.552941024303 0.133332997561 0               % bone weights ... range from 0.0 to 1.0 (if the model has bones  ) ... The sum must always be 1.0 ... if a bone do not move this vertex, only then the value is 0

XNA right handed coordinate system
Spoiler:

XNA (and OpenGL) uses a right-handed coordinate system by default, meaning that if you hold out your right hand, extending your thumb, index and middle fingers so that they form three perpendicular axes (as shown in the image above), your thumb shows the direction of the positive X axis, your index finger the positive Y axis, and your middle finger the positive Z axis. Clearly, once your fingers are in place, you can orient your hand any way you like; the default XNA (and OpenGL) orientation is that X extends to the right, Y extends upwards, and Z extends towards the camera.

Good luck with MATLAB ... It would be interesting to know what you plan.

Sekali lagi saya tekankan lucky not by accident but lucky by design.
Kesuksesan adalah kemampuan anda untuk bangun kembali dari proses kegagalan.

Spoiler:

BTW:
If you search for a WRONG lol!  format description Laughing , then you can find it here [You must be registered and logged in to see this link.] Laughing cyclops

XNAaraL
XNALara teacher
XNALara teacher

Male Сообщения : 688
Location : Германия

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum