Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

JMLCurves, Mathematical and graphical curve representation

Discussion in 'Assets and Asset Store' started by Metalero91, Apr 28, 2012.

  1. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    JMLCurves


    JMLCurves is a collection of scripts whose purpouse is mathematical and graphical representation fo curves in 3D space,designed for use exclusively in Unity Engine.

    Currently, there are six (6) different types of curves:

    1. JMLStraightCurve
    2. JMLSineCurve
    3. JMLSpringCurve
    4. JMLEllipsoidCurve
    5. JMLThreePointsCircleCurve
    6. JMLBezierCurve

    JMLCurves also features full Editor integration for easy Curves instantiation and management.

    In addition, JMLCurves has two extra components:

    • JMLCurveRenderer
    • JMLCurveCollider

    With full Editor Integration too.


    The main purpose in using JMLCurves, is to make Paths. This way you can make game objects move smoothly following a curve. Anyways you can give JMLCurves the any purpouse, just be creative!

    Screens:













    Demo:

    http://jml-universe.zxq.net/Demos/JML%20Curves/JMLCurvesDemo1.1.html

    Manual:

    http://www.mediafire.com/view/?a1h8ddr9vwb98ci

    Asset Store Link:

    http://u3d.as/content/jmls-universe/jmlcurves/2SR
     
    Last edited: Mar 16, 2013
  2. simone007

    simone007

    Joined:
    Oct 30, 2008
    Posts:
    221
    Nice one, I may need it
     
  3. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    Thanks, feel free to ask anything you want.
     
  4. DEtH_MoroZ

    DEtH_MoroZ

    Joined:
    Nov 22, 2011
    Posts:
    44
    Very nice stuff, looking forward to buy it. Any solution for 2d curves on gui layer? ;)
     
  5. smitchell

    smitchell

    Joined:
    Mar 12, 2012
    Posts:
    702
    Looks great, I ill be purchasing this puppy, would be cool to have camera follow these paths :) you should make a few demos that shows this...
    Thanks,

    Scott
     
  6. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    Thanks for the comments.

    I should transfer all the system to a 2D representations, and the find a way to "draw" on GUI Layer (I have no idea how to deal with GUI Layer, i've always used OnGUI and custom GUI systems)
    But if more people need it, i'll make it.


    That is a great idea, and it's really easy to implement, if I have some time these days I'll upload a demo showing that.
     
  7. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
  8. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    The package has been updated to be used in Unity 4.0
     
  9. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
  10. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    I think this is great. I suppose we can add points for the bezier in runtime?
     
  11. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Really nice... bookmarked! :)
     
  12. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    nuverian, Indeed you can. if you've played the WebPlayer Demo, in the 2º scene (called Example 01, the one where you can shoot "fireballs"), when a Bezier curve is spawned, it's created on the fly (in that situation, with only one anchor point).

    Right now, natively, you can easily add anchor points "at the end" of the anchor point collection. Anyways, you can insert an anchor point in any position, but it will require some lines of code (not many, around 6 or 7) instead of only one. (If you're not a programmer and need that functinallity, feel free to contact me via PM, and I'll try to help you)

    Thanks, I appreciate that :-D
     
  13. Mordokak

    Mordokak

    Joined:
    Aug 24, 2013
    Posts:
    3
    Hi first of all nice work for with the asset, I been using it for long now and must say is very powerful and intuitive. One of the things I currently trying to deal with is moving an object a long a JMLBezierCurve, I know I can achieve this by using getPoint(t) method and increase t value over time from 0 to 1 in Update().

    The only problem with this is that since is a Bezier curve the object tends to accelerate at extremes and decelerate at curves because although t increments at a constant rate, the distance between points returned by getPoint(t) is not constant.

    Example:

    bcurve.getPoint(0) returns Start Point, bcurve.getPoint(1) returns Last Point but curve.getPoint(0.5) does not match the mid point of the curve.

    Can I achieve a constant motion without acceleration using any of current methods? if so can you provide an example? And if not could you point me how or could you help me adding a getPointConstant(float t) and a getPointAtDistance(float distance) methods at JMLBezierCurve, I think both of this would be an excellent addition to your asset.

    Thanks for your time and keep on with the good work : )
     
    Last edited: Aug 24, 2013
  14. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    Hi Mordokak,

    Thanks for purchasing the JMLCurves package.
    With the current methods, it's not possible to achieve what you need. However, today's your lucky day :), because your post inspired me to make it possible.

    The new package will have one new property and three new methods to the JMLCurve class:

    1) LinearPointQuality [int] : this property sets the "quality" of the "GetLinearPoint(float t)"/"GetPointAtDistance(float distance)" method. The higher this value is, the most accurate the points returned are, and the more expensive the "UpdateLinearPoints()" is.

    2) "GetLinearPoint(float t)" : this method is similar to the GetPoint(float t) method, but it return a "linear speed" point (not sure how to call it, but this is what you needed)

    3) "GetPointAtDistance(float distance)" : as it names says, it return the point at distance "distance" from the start (or extremes if distance is out of bounds)

    4) "UpdateLinearPoints()" : to be able to call "GetLinearPoint(float t)", it's needed to reparametrize the curve... and that (the reparametrization) is a heavy algorithm, that is needed to be called each time the curve is modified (and the first time when the curve is created).


    I will add the proper editor support, two examples to the package and take some time to test it, so it won't be available right now (I estimate I'll have it done for the next weekend, plus the time it takes to be accepted by the Asset Store)

    If for some reason you need it ASAP, send me a PM.

    Regards,
    JMLUniverse-
     
  15. Mordokak

    Mordokak

    Joined:
    Aug 24, 2013
    Posts:
    3
    That's awesome news ^_^, thank you so much. If you need need help with the dev, or just need some debugging and testing I will be glad to help, although I'm a experienced coder my maths aren't as good as I would like them to be, but once again count on me for what you need, I will PM you my contact info.

    Thanks, this asset is awesome, with a dev that takes care of his work, if someone didn't buy it yet... THEY SHOULD! : )
     
  16. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
  17. DevNoob

    DevNoob

    Joined:
    Jul 30, 2013
    Posts:
    2
    I bought this asset just few days ago, and I have a problem.

    BezierCurve didn't work, it cause an error and i can't fix this.

    Curve didn't make any Anchor and Point.

    UnassignedReferenceException: The variable FirstPoint of 'JMLBezierCurve' has not been assigned.
    You probably need to assign the FirstPoint variable of the JMLBezierCurve script in the inspector.

    This is a Error Message. What can i do now?
     
  18. Metalero91

    Metalero91

    Joined:
    Mar 19, 2012
    Posts:
    83
    It's strange, it seems to be that for some reason, the FirstPoint transform is not assigned (this should be created automatically if you create the GameObject from the menu).

    Maybe you just added the script to an object manually (in which case, it won't create anything automatically). If that the case, you only need to assign an (preferably empty) GameObject to the FirstPoint public variable (and the same for LastPoint, or EndPoint, (I don't have access to the code right now, and I don't remember exactly the name of the variable) )

    If that doesn't help, please, post a screenshot of the Herarchy and the Inspector with the BezierCurve object selected, so I can see what is happening.

    Regards,
    JML