Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Spline Editor

  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
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  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.

  7. #7
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Holidays are great for that: work work work work work! Loving it so far... About 1400 lines down, an estimated 2500 more to go. At this rate, I can have 1 or 2 days for school work and still have 4-5 days R&R, so its looking good. Hate weeks for that because once you finish school, do work, chill for 5 mins, play some black ops and etc, you only end up with enough time to open up your IDE, check out where you were and close it again

    I assume its all based on the bezier curve am I right? Although the GUI might not be exactly my area of interest, the algorithm and implementation would definitely be handy, an porting required to get it over to OpenGL or is it written in OGL from the start?

    cheers,
    code_glitch
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  8. #8
    I separated the spline from the rendering part (like everyone else should do!), so you can fetch my spline class and just get a list of line segments out of that. I also have other spline code for different kinds such as Catmull-rom and Hermite splines, if you're interested. I won't use them in the editor though.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  9. #9
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Nice! Glad to see you working on your engine/designer again.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  10. #10
    Things have taken slightly longer than I expected, but still... new update.

    As said, the view menu is fully functional. You can also use the list of anchors to quickly select an anchor and see it's properties. Also, the red plus-signs allow you to insert new spline-anchors to make more complex splines, like this one.



    The main things that I still need to do are: import/export functionality, add upvector support, make those properties work (bottom-left) and fix a bunch of small buggies.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Page 1 of 2 12 LastLast

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
  •