Thanks! I'm not ready to post a new update yet but if you're interested, this is the IWaterSurface class:
class IWaterSurface : public IObject
{
public:
float StageOneScrollU, StageOneScrollV, StageTwoScrollU, StageTwoScrollV, StageThreeScrollU, StageThreeScrollV;
IWaterSurface( )
{
StageOneScrollU = -0.001f, StageOneScrollV = 0.000f;
StageTwoScrollU = 0.002f, StageTwoScrollV = 0.000f;
StageThreeScrollU = 0.003f, StageThreeScrollV = 0.000f;
}
void Update( )
{
dbScrollLimbTexture( id, 0, StageOneScrollU, StageOneScrollV );
dbScrollLimbTexture( id, 1, StageTwoScrollU, StageTwoScrollV );
dbScrollLimbTexture( id, 2, StageThreeScrollU, StageThreeScrollV );
return;
}
void SetScroll( float U1, float V1, float U2, float V2, float U3, float V3 )
{
StageOneScrollU = U1, StageOneScrollV = V1;
StageTwoScrollU = U2, StageTwoScrollV = V2;
StageThreeScrollU = U3, StageThreeScrollV = V3;
return;
}
void SetAlpha( float a )
{
dbSetAlphaMappingOn( id, a );
return;
}
};
And this is the 'NewWaterSurface' function:
IWaterSurface* NewWaterSurface( ITexture* waterTexture, float xSize, float ySize, float WaterTextureScale )
{
IWaterSurface* water = new IWaterSurface;
water->id = FindFreeObject( );
dbMakeObjectPlain( water->id, xSize, ySize );
int mesh;
mesh = FindFreeMesh( );
dbMakeMeshFromObject( mesh, water->id );
dbAddLimb( water->id, 1, mesh );
dbAddLimb( water->id, 2, mesh );
dbRotateLimb( water->id, 0, 90.0f, 0.0f, 0.0f );
dbRotateLimb( water->id, 1, 90.0f, 0.0f, 0.0f );
dbRotateLimb( water->id, 2, 90.0f, 0.0f, 0.0f );
dbOffsetLimb( water->id, 1, 0.0f, -0.015f, 0.0f );
dbOffsetLimb( water->id, 2, 0.0f, -0.03f, 0.0f );
dbTextureLimb( water->id, 0, waterTexture->id );
dbTextureLimb( water->id, 1, waterTexture->id );
dbTextureLimb( water->id, 2, waterTexture->id );
dbDeleteMesh( mesh );
dbSetObjectLight( water->id, false );
dbSetAlphaMappingOn( water->id, 33.3f );
dbScaleObjectTexture( water->id, WaterTextureScale, WaterTextureScale );
dbSetObjectCull( water->id, false );
dbXRotateObject( water->id, 180 );
return water;
}
Basically, I just create a plain, get the mesh and add a couple limbs, then offset them. Then, I texture the plains and in the 'Update( )' function the textures are scrolled every frame. If you choose, you can specify how much they scroll individually.