TAG: unity3d

A little place for me to spew hot crazy on you.

Free-Form Deformation Part 2

Awhile back I wrote a short post on free form deformation using the Sederberg/Parry paper Free-From Deformation of Solid Geometric Models.  That version of my code was based on a school project and contained a lot of unnecessary functionality.  So I present you with Free-From Deformation version 2.0.  The unnecessary bits and 3rd party dependencies are gone, replaced by a dependency on Unity3D.  My code is incredibly simple, adapting it to another framework won't…

Echo Shader: Update

[Update: 7/17/2013] Multiple echo post here. My original echo shader, posted on [7/03/2012], contained a couple of semantic errors that resulted in odd shading when using anything but the default 'White' texture. Below you'll find a simplified version plus a modified example that allows you to switch between textured and untextured shading. I hope that my code has enough comments to suffice as a tutorial of sorts. *Click to launch echo app…

Unity3D: Semi-dynamic asset path

Unity3D builds assets in a very specific way. Each project has an 'Assets' folder at the root level that Unity watches for modifications. When a mod is found, the Editor updates the relevant files in real-time and you carry on your merry way.  The same is true for any folder under 'Assets'   So what if you want to use a folder from your desktop, a portable device, a network share, etc?  Unity's Editor currently does…

Unityscript inheritance

Unity's engine offers support for unityscript, a strongly typed version of javascript specific to their engine. Unityscript offers the simplicity of javascript plus some of the power of C#. It's a good place for beginners to start. Unlike javascript, unityscript directly supports notions of object oriented programming. Namely classes and polymorphism. From a recent SO answer I made, here is an example of unityscript polymorphism in action. #pragma strict //iOS requires string typing so lets force…

Unity Wireframe

Quick post: Here is a Unity script to display a mesh's wireframe.  Requires Unity Pro if you use Unity version >= 3.5.7, should work with Unity Indie version >= 4.0.  This script was adapted from a couple of Unity community scripts. Code: var lineColor : Color; var backgroundColor : Color; var ZWrite = true; var AWrite = true; var blend = true; var lineWidth = 3; var size = 0; private var lines : Vector3[]; private var linesArray : Array; private var lineMaterial : Material;…

Unity3d and Microsoft Kinect SDK

[update: 2/25/2012] Several users have pointed out that there are ways to directly integrate the Microsoft Kinect SDK w/ Unity3D. That is definitely true. Using sockets suited my needs at the time but restrictions on the Microsoft SDK license forced me to switch back to PrimeSense's open source drivers.       Below are the steps I took to implement real-time Kinect data inside of Unity3D. My approach uses a simple TCP server to…