Results 1 to 10 of 20

Thread: Spline Editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Spline Editor

    Hey guys,

    It's been a while since I last worked on a Pascal project, but it's about time I start something new again. This project involves building a WYSIWYG spline editor that I will use for TubeRunner (Which I really hope to finish in October this year). Features include:

    > WYSIWYG editing by dragging handles (done)
    > Move/Zoom camera with mouse (done)
    > Switch between views (top/side/front)... yes It's a 3D spline.
    > Click on spline to create a new anchor
    > Manual editing of coordinates & tangents
    > Load/Save the spline to an XML

    Screenshot:



    This is my first project done in Lazarus (It won't work on Delphi). I must say that I'm really impressed with Lazarus, allthough there are some small points where delphi still excells.

    The good thing is that this program is a general purpose spline editor, so anyone can use it. Therefore I will donate the source to the community under some very non-restrictive license.

    I did most of the work yesterday and I made a lot of progress. I will probably finish it in 2 weeks.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    Looking good mate

    cheers,
    Paul

  3. #3
    Looks nice. My personal favorite though are splines that go through the points, using next ones in the route as control points. It's propably called Catmull-rom.

    And there it was: http://www.pascalgamedevelopment.com...ll=1#post38234

    Last edited by User137; 11-04-2011 at 03:37 PM.

  4. #4
    Yes I know how to draw those too. This program will be use Bezier-splines because I found them to be most effective for tunnels used in race-games. Feel free to extend the program to support Catmull-Rom splines, once I have published the source.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Nice indeed, I may even in fact have a use for this one, and that isn't something I can say about most of the stuff on my HDD, or even in my life. Sweet. It saves into XML right? Any chance of CSV? With my coming up with a XML parsing system almost from the ground up I'm trying to avoid it like the plague for now
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  6. #6
    It doesn't do much yet, but I'm planning on XML import/export. I keep the export functionality separated from the rest of my code, so you can easily add CSV support yourself.

    You can now drag a "handle" to the side of the screen and it will start scrolling in that direction. Very handy when working on large splines with loads of detail.

    Update: Just made the entire view menu functional. You can switch between XY, YX and XZ view-planes, zoom in/out, show/hide the tangents and reset the camera of the viewport. If I can keep going at this rate, I will be done next weekend.
    Last edited by chronozphere; 11-04-2011 at 09:56 PM.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •