Browsing articles tagged with " line"
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 […]

Dec
20
2018

Marching Ants Sprite Outline Shader

Saw interesting question here https://forum.unity.com/threads/animated-outline-effects-using-shader.600028/ and unity sprite outline https://github.com/wlgys8/Sprites-Outline + stackoverflow https://stackoverflow.com/a/16856878/5452781 to the rescue! (although this is for 2D sprite..) Results: TODO – Test how this would look with screenspace values (to keep same size even if zoomed) – Maybe could check neighbor pixel […]

Sep
23
2017

Drawing 2D lines and Adding Collider to it

Hi awesome reader! In our past tutorial “How to Draw Line” we discussed about drawing a line in the game by mouse interaction. But sometimes we need to draw a line that collides with our game objects in 2D mode. So we need to add […]

Aug
27
2017

Drawing Lines

Hi dear reader! In this tutorial we want to learn how to draw a line in unity by user mouse movement and interaction. First we need a component that would be able to render simple lines. Our choice is ​Line Renderer​, this component is able […]

Jul
3
2016

Fake Tube Light Shader

Tried to test idea about tube lights (or “line light”), by using custom lighting in shader, you could sample the light several times from different positions/angles, so that it looks like the light is not just a single point. (not really working here properly yet, […]

Oct
21
2012

Trajectory Test Scene 2.0

Using trajectory script from unity answers, this is a test for the Rampart prototype.. Would be nice to add the trajectory preview line also (I think I’ve seen that in the forums..) and some randomness or wind? Red target mark is light projector, with custom […]

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

Dec
5
2011

Snake

Yay for Snake games..Oo You can try pushing the snake backwards also..but its not easy with many segments. Would be interesting to add to this: – Eating objects, makes the snake longer – Ground marks, vertex or texture paint into ground plane – Collision to […]

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.