Page 1 of 1

Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 3:39 am
by kirby
Hi people in Ged forum i've been while not online, though.....
Here my example of verlet..... Sorry i made a mistake that i deleted the source.
This isn't a good one because i don't know how to draw a line to another point.

While i dunno if anyone know what is verlet physics. :D
I wanna make it better but theres less functions for me to operate just a single instances.
-Like collision on same instances.

Ah i posted the source..... :?

Re: Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 4:17 am
by pyrometal
Very good demo Kirby, your physics are really good! It sure has been a while since you've been on the forum (like you said). To draw lines, you can use a large canvas with the functions moveto(x,y); and lineto(x,y);. You can set the line color/size/transparency by using setpen(r,g,b,t,p); Good luck!

--pyro

Re: Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 4:55 am
by kirby
:cry:
>,< Can't get to work, when it draws, it stupidly draws from the origin of the canvas(0,0)..... Even i used moveto(x,y);
And how do i refresh the canvas that it just keep drawing more lines until the screen on left corner goes dark.....
:shock:

Re: Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 5:50 am
by pyrometal
You have to use moveto(x,y) before anything else, and also use erase(0,0,0,1); to reset the canvas to transparent(before drawing). Everything the canvas has to do should be in it's "draw actor" event in order to refresh every frame. Hope this helps solve some of your problems...

Re: Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 3:04 pm
by kirby
Ok thanks now i get it to work.....

Re: Verlet Physics Demo

PostPosted: Fri Dec 19, 2008 6:04 pm
by zygoth
This is really cool! This would be great to use in games. If you can, I would love to see the source code if you can remake it. I almost never use canvases though so I cant help you there, sorry.

Zygo

Re: Verlet Physics Demo

PostPosted: Sat Dec 20, 2008 4:26 am
by kirby
Here the source or from the top. Some stuff explains..... :lol:
[][][][][][][][][][] \/\/\/\/\/\/\/\/\ /\\//\\//\\//\\// {}{}{}{}{}{}{}{}{}{} -_-_-_-_-_-_-_-_- ()()()()()()()()()()
[[]][[]][[]][[]][[]] {{}}{{}}{{}}{{}}{{}} (())(())(())(())(()) |_|_|_|_|_|_|_| 0o0o0o0o0o0o0o
:D :) :( :evil: :twisted:

...This game-editor forum board is bad, i always have to relogin after a while, thats annoying.
:? My Game Site: www.freewebs.com/kei10/index.htm

Re: Verlet Physics Demo

PostPosted: Tue Dec 30, 2008 1:38 pm
by Azou
Well done,Kirby! :mrgreen: