Jump to content
  • Advertisement
Sign in to follow this  
Dynamo_Maestro

Collada <vcount>

This topic is 2475 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 am trying to make sense of what vcount means in a *.dae (collada) file, I am not familiar with callada at all and tbh this is my first real time reading or attempting to parse a dae, I have exported a simple cube from blender (the startup cube).

I'll spare most of the code since I am well aware of the rest and what they do.


[color=blue]<[color=#a31515]polylist[color=blue] [color=red]material[color=blue]="[color=blue]Material1"[color=blue] [color=red]count[color=blue]="[color=blue]6"[color=blue]>
[color=blue] <[color=#a31515]input[color=blue] [color=red]semantic[color=blue]="[color=blue]VERTEX"[color=blue] [color=red]source[color=blue]="[color=blue]#Cube-mesh-vertices"[color=blue] [color=red]offset[color=blue]="[color=blue]0"[color=blue]/>
[color=blue] <[color=#a31515]input[color=blue] [color=red]semantic[color=blue]="[color=blue]NORMAL"[color=blue] [color=red]source[color=blue]="[color=blue]#Cube-mesh-normals"[color=blue] [color=red]offset[color=blue]="[color=blue]1"[color=blue]/>
[color=blue] <[color=#a31515]vcount[color=blue]>4 4 4 4 4 4 [color=blue]</[color=#a31515]vcount[color=blue]>
[color=blue] ...
[color=blue] </[color=#a31515]polylist[color=blue]>

According to the dae documentation, <vcount> is described as
Contains a list of integers, each specifying the number of vertices for one polygon described by the <polylist>
element.[/quote]

Maybe its me but I cant seem to get my head around that, doing a quick search I came across http://www.gamedev.n...animation-data/ which confused me even more.

So I go in blender and removed the material & texture assuming it was to do with the default material / texture on the cube and export again, this time the part of the file is


[color=blue] <[color=#a31515]polylist[color=blue] [color=red]count[color=blue]="[color=blue]6"[color=blue]>
[color=blue] <[color=#a31515]input[color=blue] [color=red]semantic[color=blue]="[color=blue]VERTEX"[color=blue] [color=red]source[color=blue]="[color=blue]#Cube-mesh-vertices"[color=blue] [color=red]offset[color=blue]="[color=blue]0"[color=blue]/>
[color=blue] <[color=#a31515]input[color=blue] [color=red]semantic[color=blue]="[color=blue]NORMAL"[color=blue] [color=red]source[color=blue]="[color=blue]#Cube-mesh-normals"[color=blue] [color=red]offset[color=blue]="[color=blue]1"[color=blue]/>
[color=blue] <[color=#a31515]vcount[color=blue]>4 4 4 4 4 4 [color=blue]</[color=#a31515]vcount[color=blue]>
[color=blue] ...
[color=blue] </[color=#a31515]polylist[color=blue]>

As a result I am now really confused
Regards

Edit: I suppose the area of confusion really is "what am I getting 4 (or 5) of 6 times"

PS. I have 48 integers in <p> (indices), am I correct to assume vcount is COLLADA's way of telling me if my indices are triangular / quads?

Share this post


Link to post
Share on other sites
Advertisement
vcount seems to be the vertex count for the 6 polygons in the cube. Each of the sides is a quad containing 4 vertices. If vcount was "3 3 3 3 3 3 3 3 3 3 3 3", you would have a triangulated cube.

Share this post


Link to post
Share on other sites
Sorry, my first post was wrong, I was thinking of something else. vcount looks like the vertex count for each polygon - if it's a cube, you'd expect 6 lots of 4-vertex polys

The 48 integers in <p> will be your index lookups for vertex and normal for your 24 vertices (6x4) in this form <p>vnvnvnvn...etc<p>

Share this post


Link to post
Share on other sites

vcount seems to be the vertex count for the 6 polygons in the cube. Each of the sides is a quad containing 4 vertices. If vcount was "3 3 3 3 3 3 3 3 3 3 3 3", you would have a triangulated cube.


Cool thanks, I had a hunch it may have been that but wasnt sure.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!