Unity-ProceduralPrimitives
Unity-ProceduralPrimitives copied to clipboard
Procedural builder for some basic primitives in Unity
trafficstars
Unity-ProceduralPrimitives
Procedural builder for some basic primitives in Unity
- Sphere
- Box
- Cylinder
- Capsule
- Torus
- Grid(Terrain)
- Polygon(Triangle, Rectangle, Circle etc..)
- Polyhedron
Screenshots

Usage
Sphere

_sphere.Generate(
radius: 1f,
level: 4,
_redMaterial
);
Box

_box.Generate(
width: 1f,
height: 1f,
depth: 1f,
segments: 4,
_yellowMaterial
);
Cylinder

_cylinder.Generate(
radialSegments: 24,
heightSegments: 24,
topRadius: 0.5f,
bottomRadius: 0.5f,
height: 2f,
_blueMaterial
);
Capsule

_capsule.Generate(
radius: 0.5f,
height: 1f,
lats: 16,
lons: 32,
rings: 2,
_redMaterial
);
Torus

_torus.Generate(
majorRadius: .5f,
minorRadius: .25f,
majorSegment: 24,
minorSegment: 16,
_yellowMaterial
);
Grid(Terrain)

_grid.Generate(
width: 12f,
height: 6f,
divX: 12,
divY: 12,
_blueMaterial
);
Polygon

_polygon.Generate(
shape: 3,
size: 2f,
_redMaterial
);
Polyhedron

_polyhedron.Generate(
type: SolidType.Icosahedron,
size: 1f,
_redMaterial
);
License
MIT