Code Monkey home page Code Monkey logo

easycurvedline's Introduction

Easy Curved Line Renderer

Easy rendering and editing of curved lines in Unity

Requires Unity 2017.1 or higher.

This is a project born from the Easy Curved Line Renderer utility originally created by AcrylicCode and posted on the Work In Progress forum of Unity, then modified by GPV.

AcrylicCode discovered how to easily smooth out any set of positions, thus easing the creation of some simple Curved Line Renderers.

GPV adapted the original project to the newer versions of Unity, making some changes and exploiting the line texturing feature added since Unity 2017.1.

Also useful for rendering solid lines (e.g. wires, pipes, speech bubble tails...)

image

Animation in the included example scene

Features

Included:

  • scripts:
    • LineSmoother
      • main utility script for smoothing out positions
      • static function so it can be accessed without being attached to a game object
      • feed it an array of Vector3 and a segment size and you will get back a smoothed out array!
      • segment size is world space and so the number of line segments in between points adjusts based on distance between points
    • CurvedLineRenderer
      • example use case for smoothed out positions
      • add new points and it will automatically update to include the new position!
      • example scene is provided with a regular curved line and a curved line with physics applied to each point
    • CurvedLinePoint
      • draws gizmo and sends back to CurvedLineRenderer to update line when the point is moved
  • textures and materials:
    • normal maps to make curved lines look like their were solid
    • sample ready-to-use materials for lines (unlit and wires or pipes)

image

Curved lines and their gizmos

Documentation

An example scene is provided to demonstrate different usages of the included assets.

To see how Easy Curved Line Renderer work, see EasyCurvedLine example scene in Assets/EasyCurvedLine/Examples.

Context menus are added to Unity Editor to ease the creation of curved lines.

  • In Game Object menu (and in the Hierarchy view context menu) a new Curved line menu item is present in Effects sub-menu.
  • In Curved Line Renderer component there is a menu item for adding new line control points.
  • In Curved Line Point component there are menu items for adding new line control points.

If you don't want this feature in your Editor you can simply delete the EasyCurvedLine/Scripts/Editor folder.

You can find the Easy Curved Line Renderer reference documentation in Documentation folder both as compressed HTML and zipped HTML.

Acknowledgements:

The first implementation comes from the Easy Curved Line Renderer post on Unity forum. Some new features were inspired by people who suggested or asked for them, and all the people who shared their ideas on that post. Thanks in advance to all the people who contributed and will contribute in any way to this project.

Contributing

Contributions from you are welcome!

If you find bugs or you have any new idea for improvements and new features you can create an issue on GitHub (please follow the suggested template, filling the proper sections). To open issues or make pull requests please follow the instructions in CONTRIBUTING.md.

License

Code released under the MIT License.


For Windows users: to try this project with Unity go to the repository page on GitHub press the button Clone or download and choose Download ZIP. Save and unzip the archive to your hard disk and then you can open it with Unity.

easycurvedline's People

Contributors

gpvigano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easycurvedline's Issues

Adding the ability to loop the spline

Would it be possible to create a loop option. where you can connect the last node to the first node and have it be a smooth line continuing through it. I was able to add the first node as a last node in the chain when it's drawing the spline, but my programming skills are limited and I cannot work out how to make it carry on as a smooth spline through the first node.

Line width not updating

EasyCurvedLine_Bug

EasyCurvedLine: Sep 15, 2020
Unity3D: 2019.3.11f1 Mac

Curved line Renderedr not effecting in real-time the Line Renderer. Tested with Auto Update enabled and disabled.
Example: Line Width property does not affect the line on the scene, The scene must be reloaded, and select the line again to view any changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.