Browsing articles tagged with " algorithm"
Aug
7
2013

Procedural Tree Mesh Generator (wip)

Small test for doing procedural trees.. (screenshot showing trunk with resolution 8 and 5 sides..) Current features: – Trunk creation: adjustable height, height segments, resolution (amount of “sides”) – Using quads – Perlin noise rotations for trunk direction – Adjustable root segment radius multiplier (so […]

Oct
10
2012

Flood Fill Algorithm

Converted this c# flood fill algorithm to unityscript. Using list, instead of that queue thing and modified it to work with grid array, instead of bitmap colors.. Bit too slow, if I want to try big grid.. maybe 4096×4096. (wont be using setpixel on that, […]

Apr
7
2012

Verlet Integration

Testing Verlet Integration for Unity, converted from processing/java. (screenshot doesnt look too interesting..) (Verlet Integration Example by Ira Greenberg , licensed under Creative Commons Attribution-Share Alike 3.0 and GNU GPL license) So far the ropelines work fine, looks like realistic physics.. Not sure if I […]

Apr
3
2012

Diamond Square Algorithm

Converted Diamond Square Algorithm / random midpoint displacement fractal from Processing (original by “Justin Seyster”) to Unity C#. *See also related forum topic. Release#1: – Color32 array with SetPixels32() (instead of plotting each pixel at a time..) – Replaced “/2” with “*0.5f” (supposed to be […]

Mar
26
2012

Monotone Chain Convex Hull Algorithm

Finally got atleast some 2D convex hull algorithm working.. this one is converted from those Java & Python versions. Converted the java version first and it kept giving strange results, then took the sub() from python and it worked rightaway.. Now can try this for […]

Jan
27
2012

Simple Shadow Casting Algorithm

Converted part of this code into Unity(js) : A Simple Algorithm For Casting Shadows Screenshot info: – Red lines = from camera to vertex – Green lines = from vertex to ground – Blue lines = shadow plane vertices (no plane on this version yet, […]

Jan
19
2012

Bresenham’s line algorithm (Unity javascript)

* image from wikipedia, public domain Converted this function to Unity javascript: http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm Notes: It works.. Webplayer: http://unitycoder.com/upload/demos/Bresenhamline/ Download webplayer source: Bresenham.unitypackage

Jan
15
2012

Xiaolin Wu’s line algorithm to Unity Javascript

Converted this function to Unity3D Javascript : http://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm (Still has few bugs left..see that vertical line in screenshot..) Webplayer: coming later Can anyone find the error in this code? Why doesnt it draw vertical lines..? !note, couple lines are commented out, swapping x<>y, if I […]

Dec
29
2011

Hill Climbing AI *Update#2

Testing Hill Climbing AI (work-in-progress) Read more: http://en.wikipedia.org/wiki/Hill_climbing & http://sgd.cs.colorado.edu/wiki/Collaborative_Diffusion & http://www.agentsheets.com/Applets/ultimate-pacman/readme.html Basic idea is that the monsters will find you based on the “hill” height. They keep moving towards the highest point, which is the player. As you can see from the image, the […]

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.