Ogre3d btHeightfieldTerrainShape and normals?

Thyrion
Posts: 6
Joined: Sun Mar 09, 2014 1:55 pm

Ogre3d btHeightfieldTerrainShape and normals?

Post by Thyrion »

Hi,

my problem:
- meshdecal on btHeightfieldTerrainShape is only displayed on the backface (screenshot attachement)

info:
- had the same problem with btStaticPlaneShape(btVector3(0, 1, 0), 0); // here the decal is only shown on the backface.
when i use btStaticPlaneShape(btVector3(0, -1, 0), 0); the decal is shown correctly...

- the btHeightfieldTerrainShape fits exacly the normal terrain, so i think it cannot be on the wrong side(upAxis = 1)?

It looks like if i just have to flip the normals of btHeightfieldTerrainShape (How)?
You do not have the required permissions to view the files attached to this post.
Thyrion
Posts: 6
Joined: Sun Mar 09, 2014 1:55 pm

Re: Ogre3d btHeightfieldTerrainShape and normals?

Post by Thyrion »

still didnt find a way to flip the y normals ....

the backface of the btHeightfieldTerrainShape is definitly on the upperside.
when i use btTriangleRaycastCallback::kF_FilterBackfaces on rayTest the terrain is ignored, but from behind it works.


nobody has/had this problem? :(
Thyrion
Posts: 6
Joined: Sun Mar 09, 2014 1:55 pm

Re: Ogre3d btHeightfieldTerrainShape and normals?

Post by Thyrion »

some progress .....

gave the flipquad a chance:
if (m_flipQuadEdges || (m_useDiamondSubdivision && !((j + x) & 1)) || (m_useZigzagSubdivision && !(j & 1)))

disabled bool flipQuadEdges (but all ogre threads i found turned it on)

Now the decal is on the correct side ... but a bit under the terrain ...
so i moved it out a bit ...

still much to do :(
You do not have the required permissions to view the files attached to this post.