Sign in to follow this  
rocklobster

Collada vertex format and creating Terrain

Recommended Posts

rocklobster    415
Hi guys,

Currently i'm trying to implement a terrain collision class. We are using the .dae file format from Collada and are loading the vertex data into a vbo for drawing. From this face/vertex data i'd like to create a 2d array that stores the corresponding vertexes of the vertex data. I've worked out how this can be done already, but i'm not sure if its going to because i'm unable to determine if the .dae file stores the face data in order.

[img]http://i.imgur.com/nLUie.png[/img]
This is what i'm hoping to achieve, which i believe is possible with .OBJ format because it stores the vertices in this order but from what i've had a look at, i dont think max exports the collada data like this.

Help is greaty appreciated.

- rocklobster

Share this post


Link to post
Share on other sites
lauris71    841
You cannot expect anything about the order of vertices/polygons, unless your modeling program explicitly says, that it keeps them in certain order in exported file.

Instead I'd suggest simply walking through all vertices, rounding their X & Y (maybe scaled by sme factor, if your grid step is not exactly 1) coordinates to nearest integer (thus getting array coordinates) and saving Z as the elevation at that point.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this