tutorial needed

nevarim

27-09-2013 10:37:58

hi all

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?

thanks
Neva

mikachu

27-09-2013 23:27:13

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
Procedural::Extruder().setExtrusionPath(&p).setShapeToExtrude(&s).setShapeTextureTrack(&textureTrack).setUTile(20.f).realizeMesh("extrudedMesh");

To change the width along the path, you will have to use Extruder::setScaleTrack.

nevarim

28-09-2013 19:03:12

there is no relation with terrain created? how can river "attach" on terrain?

mikachu

29-09-2013 15:46:13

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...