Code: Select all
IAnimatedMesh* addHillPlaneMesh2T(ISceneManager *smgr,
const core::dimension2d<f32>& tileSize,
const core::dimension2d<u32>& tileCount,
video::SMaterial* material, f32 hillHeight,
const core::dimension2d<f32>& countHills,
const core::dimension2d<f32>& textureRepeatCount)
{
IMesh* mesh = CGeometryCreator::createHillPlaneMesh(tileSize,
tileCount, material, hillHeight, countHills,
textureRepeatCount);
if (!mesh)
return 0;
IMesh* mesh2T = smgr->getMeshManipulator()->createMeshWith2TCoords(mesh);
mesh->drop();
if (!mesh2T)
return 0;
SAnimatedMesh* animatedMesh = new SAnimatedMesh();
if (!animatedMesh)
{
mesh2T->drop();
return 0;
}
animatedMesh->addMesh(mesh2T);
mesh2T->drop();
animatedMesh->recalculateBoundingBox();
return animatedMesh;
}However, the results look kind of strange.

It's really evident when you remove the stones.

For reference, this is how it should look like.

I've walked through lots of Irrlicht code, but can't understand why it is doing this.
* CGeometryCreator::createHillPlaneMesh() creates a mesh with 1 texture coord.
* CMeshManipulator::createMeshWith2TCoords() converts the mesh to use 2 texture coords, duplicating the first set of texture coords into the 2nd set.
* CSceneManager::addWaterSurfaceSceneNode() creates the CWaterSurfaceSceneNode instance, which doesn't do anything more than duplicate the mesh.
So from what I can tell, CWaterSurfaceSceneNode() shouldn't care whether the mesh is of S3DVertex, S3DVertex2TCoords, or S3DVertexTangents. It only changes the Y coord of the Pos, and the Normal.
Does anyone have any thoughts on what the problem could be?
FYI Mac OS X, Irrlicht 1.4.1, OpenGL device