Hello.
Tritonas was wandering if AI waypoints could be somehow generated for a meshed track (not using procedural_roads). I figured it would be easiest to import the terrain to Blender and copy the vertices of the roads to create a "navigation mesh" of sorts where individual verts would be like the waypoints. Then, the mesh could be exported to OGRE's .mesh.xml format and the waypoints could be generated from the verts. I made the following screens as I went and figured I'd make a tutorial out of them. If anything is unclear, ask for help below.
Step 1: Download blender2ogre Blender addon. Download from https://github.com/OGRECave/blender2ogre/releases . More info https://github.com/OGRECave/blender2ogre#importing-meshes
Step 2: Install the addon, see below screenshot.
Step3: enable the addon in Blender, see below screenshot.
Step4: import the *f1_track.mesh (tip: sort files by size, it's the biggest, around 3MB). For some reason, the mesh arrives rotated 90 degrees to the side. To fix it:
Step6: Shift+D to duplicate the vertices, then "Z" to restrain grab mode to Z axis and pull the verts up. Finally press P to separate the verts to new object. See screenshot below.
Step 7: use the "edge select" feature (Shift+leftclick) to select and delete one side of each road. We'll use the other side as the navmesh.
Step 8: Set up the "vertex snapping" (magnet icon on top of 3d viewport) as seen on screenshot below. Then, switch to top-down view mode using Numpad-7 key. Then manually move verts to the middle of the roads. TIP: use C hotkey for circle-select, B hotkey for box-select and proportional edit (UI selector on top of 3D Viewport).
I haven't figured how to export the verts as waypoints, though. Blender2Ogre failed me, it only exports verts which are part of a triangle. I'll have to hack ulteq's truck export scripts to export angelscript waypoints instead. For now, I'll just attach the created Blender file.
Tritonas was wandering if AI waypoints could be somehow generated for a meshed track (not using procedural_roads). I figured it would be easiest to import the terrain to Blender and copy the vertices of the roads to create a "navigation mesh" of sorts where individual verts would be like the waypoints. Then, the mesh could be exported to OGRE's .mesh.xml format and the waypoints could be generated from the verts. I made the following screens as I went and figured I'd make a tutorial out of them. If anything is unclear, ask for help below.
Step 1: Download blender2ogre Blender addon. Download from https://github.com/OGRECave/blender2ogre/releases . More info https://github.com/OGRECave/blender2ogre#importing-meshes
Step 2: Install the addon, see below screenshot.
Step3: enable the addon in Blender, see below screenshot.
Step4: import the *f1_track.mesh (tip: sort files by size, it's the biggest, around 3MB). For some reason, the mesh arrives rotated 90 degrees to the side. To fix it:
- go to Right Orthographics view using Numpad-3 key. You may need to activate Ortho view by Numpad-5 key.
- activate edit mode (tab)
- select rotation center to be the 3D cursor (UI box on top of 3d viewport panel)
- press R key for rotate mode and hold Ctrl to constraint the rotation to big steps.
Step6: Shift+D to duplicate the vertices, then "Z" to restrain grab mode to Z axis and pull the verts up. Finally press P to separate the verts to new object. See screenshot below.
Step 7: use the "edge select" feature (Shift+leftclick) to select and delete one side of each road. We'll use the other side as the navmesh.
Step 8: Set up the "vertex snapping" (magnet icon on top of 3d viewport) as seen on screenshot below. Then, switch to top-down view mode using Numpad-7 key. Then manually move verts to the middle of the roads. TIP: use C hotkey for circle-select, B hotkey for box-select and proportional edit (UI selector on top of 3D Viewport).
I haven't figured how to export the verts as waypoints, though. Blender2Ogre failed me, it only exports verts which are part of a triangle. I'll have to hack ulteq's truck export scripts to export angelscript waypoints instead. For now, I'll just attach the created Blender file.