Drawing a "track" along a motionPath


I’m currently working on a project where I want to visualize Petri nets, which I have chosen to use jME for. For doing this I have a 3d model (car/train/etc) moving along a motionPath, made up of waypoints which are generated by some magic algorithm which I constructed. However, I also want to be able to draw a road for the car, or a track for the train. Is it possible to draw a texture along my motionPath? Or maybe I would have to make a “flat” 3d model along the path, of which I can then put a road texture on. Is this possible with jME? Any help on this topic would be awesome! Thanks :slight_smile:

You will have to generate the mesh yourself to go along the track to build a road.

For example, you can sample the start and end point of the path (or between each node in the path) and then draw lines between to get the basic shape. You can then use that line and extrude it into quads, keeping in mind to account for corners. There isn’t an automatic way to do this in jme yet.