Gemstone Generator

Add to
My games
Add to
Wishlist
Save to
Collection
No reviews
Exceptional
Meh
Skip

About

This is a demo for a Unity script that allows people to procedurally generate 3D meshes of clean cut gemstones, hence it's called the Gemstone Generator. This was developed for PROCJAM 2015.

In the demo you have an example mesh generated, and you can mess around with the values above, which are the parameters of the generator.

Use the fields above to change the parameters, the coordinates field requires you to separate each number with commas (e.g. "0.5,1,1,0.5").

The shader and material come from the Gem Shader pack provided by the Unity Asset Store.

How it works

The algorithm works by taking a set of 2D Coordinates with a Y component [-1,1] and X component [0,1], and set them as vertices multiple times depending on the number of lines of symmetry.

This is achieved by working out the angle between two corners in the gemstone (360/Symmetery*2), then iterating from 0 to (Symmetry*2), setting the vertices and UVs using the coordinates rotated by the angle, and then increasing the angle. By the time it reaches (Symmetry * 2), the algorithm would have gone a complete circle, with vertices at each angle.

These vertices are then mapped by going through each symmetry again, except creating triangles going top to bottom, using the vertices of one line with the line adjacent to it.

Most of the other parameters allow extra modification of the transformation if needed (like scaling or rotating the vertices before being applied to the mesh), however the Slice Point parameter changes the shape of the mesh by creating slices that are not made from going through the symmetries normally. Instead it creates two sets of vertices, both before and after the set angle at an amount based on the size of the Slice Point [0,1].

Platforms
Release date
Developer
Gamepopper
Age rating
Not rated

System requirements for Web

Read more...
Gemstone Generator screenshot, image №1227839 - RAWG
Edit the game info
Last Modified: Jan 9, 2019

Where to buy

itch.io