Curve (waypoints) editor


Can somebody suggest me a waypoints editor?

I’ve been Googling for some time and I didn’t find anything but the CurveEditor from the XNA community but it doesn’t export the generated keys and don’t save the curve for edit later.

Thank you.

If you want something like keyframes for animation, I think 3d programs can create curbs and keyframes for export, even without a model attached. (You would just draw it 2d)

But what I have done in the past, is just make my own coordinate list…

You type in the equation for each segment (linear, geometric), and a mover-class has its position updated by this equation… For each update, it adds its current pos. to a list, which can be exported to XML… (You would update the mover in a while loop, so its almost instantanious)

You can program that in one sitting I think, since you don’t need any game logic or assets or anything.

I have also used art-tools to just DRAW curved paths… Gimp has a curve tool. -And then programmed units to follow whatever color, like any color-based stuff… (So you can have all your curves in one data-layer)

Yes, what I want is to be able to draw a curve (no matter where) to create a list of waypoints with the vertices that comprises it (see the screenshot below)

so the sprite is moving along the list of waypoints.

I’m trying to get it using Blender with an add-on that export to SVG.

I create a Bezier curve and export all its vertices but I’ve to verify whether it exports the normal in each vertex or not.

I’ll check now the curve tool of GIMP.

Thank you for your help.

You are looking for a cubic (or quadratic) bézier curve algorythm

I needed that as well and ended up doing catmull rom spline interpolation in-game.
here is a good implementation, although it’s in Java; It’s easy to adapt.

I had the exact same thing and ended up using SVG files for this. I went a bit overboard and added not only paths but also a bunch of other SVG elements. You can find the SVG code here and limited documentation here. The bottom of the doc page shows how to get a path from just the contents of the SVG path “d” element string.

1 Like

Hi guys,

Yesterday I was doing some research and I found the Curve and CurveKey classes. I did some tests and I think they must satisfice my needs.

To create one curve in 2D I define two curves (like the XNA demos do)

Curve curveX, curveY;

Every curve has a pair of values (X coord, time) for curveX and (Y coord, time) for curveY so to get one point I use the following method

public Vector2 GetPointOnCurve(float time)
    Vector2 point = new Vector2();
    point.X = curveX.Evaluate(time);
    point.Y = curveY.Evaluate(time);
    return point;

Having this I just need to create a Bezier in Blender or any other tool and export it as a plain text file (like SVG).

The question is: What’s the difference between this approach and the approach suggested by @throbax?

Thank you for all the answers.

First you would always have a set of points you want your curves to touch.
Then you would use the method I mentioned (or Catmull Rom curves in XNA by the way; The implementation I referenced just adds some more features like directly hitting all of the reference points and so on) to generate a number of points in between those reference points lying on your curve.

So when you’re specifying your control points, the algorithm would give you X points on the curve in between each of your control points.

This is just to demonstrate what I mean:

The above picture would be your control points; The below one the control points + your generated points in between lying on the curve.

Then you would go and add those points to your Curve-structure you mentioned enabling it to interpolate even more points in between. You would do that if you’d like your ship to stick to that path and if you have to get the perfect position of the ship on every update.
I don’t need that because I use the generated points directly as waypoints. The sprite moves there on its own.

Hope that clears things up a bit.

1 Like