Page 1 of 1

Importing Terrain

Posted: Wed Dec 17, 2014 6:08 pm
by cyber
I have done a fair bit of searching and can't seem to find anything regarding importing terrain data. The two most common things I see about creating terrain in Bullet is making a

Code: Select all

btHeightfieldTerrainShape
or more commonly a

Code: Select all

btBvhTriangleMeshShape
.

If I have terrain data of some other form, such as JPEG 2000, ArcGrid, IMG, GeoTiff, etc, how can I go about creating either of the above two objects in Bullet? I'm not really familiar with handling terrain data in general, so I apologize if this is a common question.

Re: Importing Terrain

Posted: Thu Dec 18, 2014 6:54 am
by tmason
cyber wrote:If I have terrain data of some other form, such as JPEG 2000, ArcGrid, IMG, GeoTiff, etc, how can I go about creating either of the above two objects in Bullet? I'm not really familiar with handling terrain data in general, so I apologize if this is a common question.
You can't and in the examples you gave it wouldn't make sense. The examples you gave are images; Bullet deals in 3D space so only 3D objects will work.

And even then they would have to be loaded and converted from their original formats in memory before you can use the appropriate Bullet classes.

Re: Importing Terrain

Posted: Sun Dec 21, 2014 11:35 am
by xexuxjy
not quite true, btTerrainShape can be updated pretty easily to use either of those formats as all you really want from them is a height value at x,y which can correspond to a grayscale (or whatever) value from your image.

Re: Importing Terrain

Posted: Sun Dec 21, 2014 11:40 am
by tmason
xexuxjy wrote:not quite true, btTerrainShape can be updated pretty easily to use either of those formats as all you really want from them is a height value at x,y which can correspond to a grayscale (or whatever) value from your image.
Fair enough; I stand corrected.