Macaw OS C reference

Function newterrain

#include <macaw3d.h>
int newterrain(int cells, int heightpicture, int texture, double tiles);

Makes hills from a picture. The terrain goes from -1 to 1 across x and z, with heights from 0 to 1, so scale it up with scale3d.

Parameters

cellsint
How many squares it has along each side. 0 or less: 32.
heightpictureint
A picture stretched over it, where brighter colours are higher. 0: flat.
textureint
The picture to cover it with. 0: plain light grey.
tilesdouble
How many times the texture repeats across the whole terrain. 0 or less: cells / 4.

Returns int

The new terrain's number.

In Shapes, terrain and models, with newcube, newsphere, newcylinder, newcone, newplane, newterrainfn, newmesh, newmodel, newsprite, newpivot.