FBX and BEPU

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ggblake
Posts: 7
Joined: Thu Sep 17, 2009 4:19 pm

FBX and BEPU

Post by ggblake »

I create a terrain model (fbx) by displacing a 256x256 mesh with a 512x512 heightmap image. When I create a bepu terrain entity using the same heightmap image, I can't get them to orient or scale properly.

Can you help with the relationships between the two items

GGB
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: FBX and BEPU

Post by Norbo »

The position of the BEPUphysics terrain is at the -X, -Z corner. If the goal center of the terrain is (0,0,0) and your terrain is 256 units (not triangles) across, then your position would need to be -128, 0, -128.

When you call setData on the terrain, you pass it the separation distance between vertices along the X and Z axes. Higher separation values scale up the terrain.

You may also find that per-quad triangles in the terrain are organized differently between the physics and graphics. When calling terrain.setData, you provide a QuadFormats option; try choosing the other QuadFormats option and seeing if the triangles agree.

Finally, the terrain does not currently offer orientation support. If arbitrary orientation is desired, consider using the StaticTriangleGroup instead.
Post Reply