Browsing articles tagged with " algorithm"
Apr
4
2019

RANSAC 2D Line Fitting

Converted this RANSAC 2D line fitting pseudocode into Unity c# http://www.visual-experiments.com/demo/ransac.js/ What is RANSAC? https://en.wikipedia.org/wiki/Random_sample_consensus Source code:https://gist.github.com/unitycoder/53495435c28853ef6522ff60d5c6a091 *Note this is not optimized at all, just a quick test Usage instructions:– Add this script to empty gameobject– Add gameobjects as a child of that gameobject (place […]

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 old unityscript sourcehttps://gist.github.com/unitycoder/90f0f1896e38a13d98e3d0c84ea45789

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 […]

Pages:12»

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

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