All Projects → federicocasares → roadifier

federicocasares / roadifier

Licence: MIT License
Open Source road mesh generator script for Unity

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to roadifier

unity-plumber
A component to procedurally generate pipe-like meshes in Unity
Stars: ✭ 55 (+83.33%)
Mutual labels:  gamedev, generator, mesh, mesh-generation, meshes
Meshlab
The open source mesh processing system
Stars: ✭ 2,619 (+8630%)
Mutual labels:  mesh, mesh-generation
snap-to-tin
Snap vector features to the faces of a triangulated irregular network (TIN)
Stars: ✭ 18 (-40%)
Mutual labels:  terrain, mesh
Delatin
A fast JavaScript terrain mesh generation tool based on Delaunay triangulation
Stars: ✭ 207 (+590%)
Mutual labels:  terrain, mesh
ofxCorkCsg
A constructive solid geometry (mesh boolean) addon for openFrameworks.
Stars: ✭ 43 (+43.33%)
Mutual labels:  mesh, mesh-generation
skeletor
3D skeleton extraction from meshes.
Stars: ✭ 115 (+283.33%)
Mutual labels:  mesh, meshes
Pts
Quantized Mesh Terrain Data Generator and Server for CesiumJS Library
Stars: ✭ 36 (+20%)
Mutual labels:  terrain, mesh
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (-43.33%)
Mutual labels:  mesh, meshes
Building Blocks
A voxel library for real-time applications.
Stars: ✭ 140 (+366.67%)
Mutual labels:  gamedev, mesh
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (+226.67%)
Mutual labels:  gamedev, generator
Point2Mesh
Meshing Point Clouds with Predicted Intrinsic-Extrinsic Ratio Guidance (ECCV2020)
Stars: ✭ 61 (+103.33%)
Mutual labels:  mesh, mesh-generation
SkeletonBridgeRecon
The code for CVPR2019 Oral paper "A Skeleton-bridged Deep Learning Approach for Generating Meshes of Complex Topologies from Single RGB Images"
Stars: ✭ 72 (+140%)
Mutual labels:  mesh, mesh-generation
styled-svg
A styled-components generator for SVG files to use in react
Stars: ✭ 37 (+23.33%)
Mutual labels:  generator
python-lorem
🐍 Python library for the generation of random text that looks like Latin
Stars: ✭ 19 (-36.67%)
Mutual labels:  generator
Unity-Procedural
Spline based mesh generation
Stars: ✭ 67 (+123.33%)
Mutual labels:  mesh-generation
Crystalshire
Legacy VB6 open-source ORPG
Stars: ✭ 24 (-20%)
Mutual labels:  gamedev
stripy
2D spherical and Cartesian triangulation toolkit using tripack, stripack, srfpack and ssrfpack
Stars: ✭ 33 (+10%)
Mutual labels:  meshes
hierarchy-icons
Unity extension to show component icons in the Hierarchy.
Stars: ✭ 47 (+56.67%)
Mutual labels:  gamedev
ameshref
Efficient Matlab Implementation of Adaptive Mesh Refinement in 2D
Stars: ✭ 28 (-6.67%)
Mutual labels:  meshes
Terrain-Generation-Study
Using Perlin noise to generate a map texture and then generate an LOD enabled terrain mesh from the map. This system was going to be used in a now abandoned project.
Stars: ✭ 23 (-23.33%)
Mutual labels:  terrain

Roadifier

(an open-source road mesh generator for Unity)

What is it?

Basically Roadifier takes a list of points and a terrain object and automatically generates a mesh representing a road of the specified width that follow the terrain's height and normals. It's great to make roads in strategy games using the standard Unity terrain, and with a couple of changes it could be adapted to make train tracks, rivers and much more!

Important Information

This repository contains an example project that includes a few Unity Standard Assets. These are distributed here only as part of the example scene to demonstrate the capabilities of Roadifier. If you are not interested in that and only want the component itself to test it out in your own project, feel free to proceed to copy the .js scripts in the Scripts directory and nothing else.

Installation

Getting Roadifier running is really easy. It's as simple as getting a copy of the .js files in the Scripts directory, creating a new empty game object and adding the Roadifier script to it. After that you're good to go.

Where can I see a demo?

You can find a demo of the latest version of Roadifier here. You can also find a short video showcasing its capabilities here.

What do the options mean?

Almost all of the settings are pretty much self explanatory, but here are the details:

  • Road Width: The width of the road mesh, specified in world units. Thinner roads usually adapt better to the terrain shape.
  • Smoothing factor: A float between 0.0 and 0.5 specifying how much smoothing should be applied to corners. Values close to 0.2 and 0.3 usually work well. Setting it to 0.0 disables smoothing altogether.
  • Smoothing iterations: How many times, between 0 and 5, the smoothing algorithm should be applied. More iterations provide smoother results but also ends up creating a lot of extra vertices and faces. It's recommended to set this to 1 or 2. Also, applying too many smoothing iterations might cause the final mesh to have artifacts.
  • Material: The material that will be applied to the road mesh.
  • Terrain Clerance: An offset in the y-axis applied to every vertex in the road mesh. It's used to avoid z-fighting against the terrain object. Values close to 0.1 usually work well, but it depends on the scale of your world and the frequency of variations in the terrain height.

How does it work?

Basically, doing a lot of math. If you like algebra, this is definitely the place for you. I'll publish a short video explaining the inner workings of Roadifier soon.

Public Methods

GenerateRoad(points : List., terrain : Terrain)

Generates a new game object containing the generated mesh for the road. It will iterate the points in the order specified in the list, making a road mesh of the specified width that connects them. The terrain parameter is optional, and will be used for making sure the road follows the height and normals of the terrain properly in each point. In case you omit it, the road will use the y-coordinate specified in each point and will use Vector3.up as the normal vector.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].