Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Collada vertex format and creating Terrain

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 rocklobster   Members   

415
Like
0Likes
Like

Posted 04 April 2012 - 10:17 AM

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.

Posted Image
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

#2 Lauris Kaplinski   Members   

841
Like
1Likes
Like

Posted 04 April 2012 - 01:57 PM

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.
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/

#3 rocklobster   Members   

415
Like
0Likes
Like

Posted 04 April 2012 - 11:08 PM

Wow thats a great idea, i can't believe it didnt cross my mind. Thanks!




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.