You could use a heightmap.
Create an PNG image where lightness of a pixel represents its height.
Make a model out of your picture
└── <your_models_folder>
├── ...
└── heightmap
├── model.config
├── model.sdf
└── materials
└── textures
└── heightmap.png
you can name the folder containing the model to your liking. I use heightmap
in this example for easier explanation.
model.config
<?xml version="1.0"?>
<model>
<name>Heightmap</name>
<version>1.0</version>
<sdf version="1.5">model.sdf</sdf>
<author>
<name>TODO</name>
<email>email@address.org</email>
</author>
<description>
A hightmap plane.
</description>
</model>
model.sdf
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="heightmap">
<static>true</static>
<link name="link">
<collision name="collision">
<geometry>
<heightmap>
<uri>model://heightmap/materials/textures/heightmap.png</uri>
<size>32 32 .8</size>
<pos>0 0 0</pos>
</heightmap>
</geometry>
</collision>
<visual name="visual">
<geometry>
<heightmap>
<use_terrain_paging>false</use_terrain_paging>
<uri>model://heightmap/materials/textures/heightmap.png</uri>
<size>32 32 .8</size>
<pos>0 0 0</pos>
</heightmap>
</geometry>
</visual>
</link>
</model>
</sdf>
Where the <size>
tags define the width, length and height of the model. This means that my heightmap will result in terrain 32x32 m large and 80 cm height. The highest point of the terrain will be exactly 80 cm above the lowest. This way you can scale your model. (note that there is size
tag for both collisions and visuals. You need to keep them the same.)
include the heightmap in your WORLD file
<include>
<uri>model://heightmap</uri>
</include>
launch the world as you normally do.
You can then work on textures for your ramp. This will result in black-and-yellow stripe texture, but the geometry will be there.
You might want to use a picture like the one below for your heightmap.