Mathart DEMO (b3)

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Mathart DEMO (b3)

Postby Game A Gogo » Wed Apr 20, 2011 12:42 am

A while ago (Like 6 months?) I decided to make a program in which you could draw lines and curved lines, the intention was to add custom curve with formulas.
But I haven't worked on this in a long while so I decided to post what I have made so far of it, enjoy! even if it's not a game :P

How to get around:
Click display -> Tools
First tool is the line tool
Second tool is the natural curve tool (sinual curve)
third tool is view move to move the view around
fourth tool is line move...
Click once and you can select a line (Might be hard when lines are all overlapped, so you can also use the left and right arrow to navigate through the lines)
Hold to move a line around
Hold shift while moving to edit the line
Press d to delete a line

Please comment!
Attachments
untitled.PNG
Mathart Demo (b3).zip
(170.65 KiB) Downloaded 297 times
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mathart DEMO (b3)

Postby savvy » Wed Apr 20, 2011 5:04 pm

great program so far :D could do with free draw, colours aaaand line thickness....
those can be difficult, but im sure a coder with your skill could do it ;)
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Mathart DEMO (b3)

Postby Game A Gogo » Wed Apr 20, 2011 7:09 pm

Free draw would make the file size so huge, this is suppose to be MATH and ART together ;)
But thanks, I don't know if I will work on this again. Maybe if people want me to
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mathart DEMO (b3)

Postby savvy » Wed Apr 20, 2011 8:09 pm

in all honesty, i dont think most people on this forum care unless its simple code.
you should continue it if you think its gonna get somewhere, otherwise its your decision alone XD
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Mathart DEMO (b3)

Postby edwardfanboy » Tue Jun 28, 2011 5:28 am

For the curve tool, you could click 3 points instead of two in this order, and have it make a Bezier spline with these points:
1. Start point
2. Intermediate point specifying how much to bulge out
3. End point
Code: Select all
10 PRINT"Hello World
20 GOTO 10
edwardfanboy
 
Posts: 40
Joined: Sat Jun 20, 2009 2:38 am
Location: Nowhere
Score: 3 Give a positive score

Re: Mathart DEMO (b3)

Postby Game A Gogo » Tue Jun 28, 2011 12:06 pm

I had many plans for this before, but I'm not working on it anymore since I had no motivations to do so. I also don't know the code of a Bezier spline
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Mathart DEMO (b3)

Postby tintran » Sat Dec 03, 2011 11:18 pm

bezierCurve function (not optimized, not sure if there is a way to optimize it).
code for drawing a bezier curve: (the larger the number of steps(last parameter) the smoother the curve, 50 should be plenty, smaller number of steps will show the curve as line segments).
Code: Select all
void bezierCurve(double x1, double y1, double x2, double y2, double x3, double y3, int steps)
{
    double px1,py1,px2,py2,dx12,dy12,dx23,dy23,dpx,dpy;
    double x,y;
    int i;
    dx12 = (x2-x1)/steps; dy12 = (y2-y1)/steps;
    dx23 = (x3-x2)/steps; dy23 = (y3-y2)/steps;
    px1 = x1;
    py1 = y1;
    px2 = x2;
    py2 = y2;
    x=x1;
    y=y1;
    moveto(x,y);
    for (i=1;i<=steps;i++)
    {
      px1 += dx12;
      py1 += dy12;
      px2 += dx23;
      py2 += dy23;
      dpx = (px2-px1)/steps;
      dpy = (py2-py1)/steps;
      x=px1+(i*dpx);
      y=py1+(i*dpy);
      lineto(x,y);
    }
}
Attachments
bezierCurve2.png
bezierCurve.zip
(1.36 KiB) Downloaded 168 times
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Mathart DEMO (b3)

Postby Game A Gogo » Sun Dec 04, 2011 3:13 pm

Thanks a lot, but unfortunately I'm not working on this anymore S:
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron