Skip to content

gcalcedo/low-poly-mesher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Low Poly Mesher (LPM)

LPM, integrated as a Unity Engine plugin, allows developers to define templates that generate low-poly meshes at runtime. This lifts developers from spending time in repetitive tasks such as creating variations of a 3D model. Once a template is defined, LPM automatically creates variations from it.

How it works ⚙️

Templates can be built from scratch or on top of simpler ones. This package provides a set of primitive templates under Assets/Scripts/Mesh Templates/Primitives and some sample custom ones built with primitives under Assets/Scripts/Mesh Templates/Nature.

While templates provide the basic shape of a 3D model, automatic variations are created through modifications. Basic modifications are located under Assets/Scripts/Mesh Modifications. Similarly to templates, custom modifications can be defined on their own or based on other ones.

Additionally, modifications can be feed into the .Anim() method to animate the generated 3D models through an interpolation between its original and modified states in a loop.

This snippet shows a basic custom template.

[System.Serializable]
[TemplatePath("Test", typeof(TestObject))]
public class TestObject : MeshTemplate
{
    public override IEnumerable<MeshPackage> Generate()
    {
        return MeshPackage.Build(
            new Box(6, 5, 6)
                .Mod(NoisePosition.X(0.2f, NoiseMode.DYNAMIC))
                .Anim(NoisePosition.Y(1f, NoiseMode.DYNAMIC), 1),
            new Pyramid(6, 5, 6)
                .Mod(Traslation.Y(3))
                .Mod(Rotation.Z(15))
                .Color("#A7F070")
            )
        );
    }
}

Some examples 🌲

The following meshes are generated in their entirety by LPM.

thumb_0148 thumb_0149 thumb_0150

About

Automatic 3D low-poly mesher for Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages