Master Of Animation, Games & Interactivity
Master Of Animation, Games & Interactivity

Theme - Tinkering as Method

Context -

I've been interested in procedural generation for a while and I've used some simple techniques in some things I've made. My studio practice is really concerned with using procedural generation to build layers of narrative in a game world so I'm trying to play with different procedural generation tasks in Unity. This week I decided to experiment with generating a mesh that could grow.

I watched a great introductory video to procedurally generating meshes from YouTuber Brackeys. https://www.youtube.com/watch?v=eJEpeUH1EMg&t=7s

I've previously done the following tutorial on procedural terrain generation, more as an exercise in understanding proc-gen techniques than anything else. https://www.youtube.com/playlist?list=PLFt_AvWsXl0eBW2EiBtl_sxmDtSgZBxB3

Method - I want to use Unity to try to program a mesh that grows. I'll start by generating a cylinder mesh and then try to extend it.

Response - The screenshots depict the result of this experiment.

  1. I found a script on the unity site to generate a number of primitive meshes by code and copied the "tube" section. https://wiki.unity3d.com/index.php/ProceduralPrimitives#C.23_-_Tube 
  2. I adjusted the code so that the radius of the bottom of the cylinder was wider than the top.
  3. I disabled the parts of the code which generate the inner cylinder of the mesh, as well as the top and bottom faces.
  4. I attempted to generate only one circle of vertices so that I could then repeat it a number of times and produce a mesh comprised of several 'stages' of cylinders. At this point I hit a problem with the way the code constructs the mesh UV's, triangles and normals. I spent a few hours trying to reconstruct the way the code does this but I couldn't get it to work.

Procedural mesh generation is hard. There is a lot of fiddly maths involved and it's application seems very limited. I think I got stuck on the math and couldn't find my way past it. Interesting none the less.

About This Work

By Nick Margerison
Email Nick Margerison
Published On: 07/08/2019

academic:

play

mediums:

interactive

scopes:

sketch

tags:

CPS Week 2, Unity