i'm searching a tutorial for to create a river or a road, must be same procedure i think (maybe change only width on river)
there are tutorial on these ideas?
Hi, there's a road sample in Sample_Extrusion :
// -- Road
// The path of the road, generated from a simple spline
Procedural::Path p = Procedural::CatmullRomSpline3().setNumSeg(8).addPoint(0,0,0).addPoint(0,0,10).addPoint(10,0,10).addPoint(20,0,0).close().realizePath().scale(2);
// The shape that will be extruded along the path
Procedural::Shape s = Procedural::Shape().addPoint(-1.2f,.2f).addPoint(-1.f,.2f).addPoint(-.9f,.1f).addPoint(.9f,.1f).addPoint(1.f,.2f).addPoint(1.2f,.2f).scale(2).setOutSide(Procedural::SIDE_LEFT);
// This is an example use of a shape texture track,
// which specifies how texture coordinates should be mapped relative to the shape points
Procedural::Track textureTrack = Procedural::Track(Procedural::Track::AM_POINT).addKeyFrame(0,0).addKeyFrame(2,.2f).addKeyFrame(3,.8f).addKeyFrame(5,1);
// The extruder actually creates the road mesh from all parameters
To change the width along the path, you will have to use Extruder::setScaleTrack.
there is no relation with terrain created? how can river "attach" on terrain?
That's easy, but there's no built-in way to do it at the moment.
Instead you can just get terrain's height at path's XZ coords, and set path's Y coord accordingly...