PDA

View Full Version : free 2d box rigid body demo for delphi!



JernejL
26-12-2004, 09:08 PM
this:

http://www.gtatools.com/secret-place/Box.zip

is delphi equivalent translation of this:

http://uk.geocities.com/olivier_rebellion/box.zip

okay, newton and ode outpreform it, but aniway it is a good example.

fire.tiger
13-10-2006, 09:31 AM
this:

http://www.gtatools.com/secret-place/Box.zip

is delphi equivalent translation of this:

http://uk.geocities.com/olivier_rebellion/box.zip

okay, newton and ode outpreform it, but aniway it is a good example.

Hi,
C++ version I can download...but I can't download
delphi equivalent (the first link)...do you know any downloadable source?
thanks

JernejL
13-10-2006, 12:24 PM
just go to http://uk.geocities.com/olivier_rebellion/ and download delphi build. the real link is:
http://uk.geocities.com/olivier_rebellion/box_delphi.zip but maybe it does not alow direct linking.

fire.tiger
16-10-2006, 06:12 AM
thanks it works. 8)

fire.tiger
16-10-2006, 06:49 AM
Have you compiled it without problems ?
I downloaded the source code, delphi DPR, opened in delphi,
I'm trying to compile, but with some errors "Udenclared Identifier: 'MS_LIB'"

JernejL
16-10-2006, 09:30 AM
Have you compiled it without problems ?
I downloaded the source code, delphi DPR, opened in delphi,
I'm trying to compile, but with some errors "Udenclared Identifier: 'MS_LIB'"

it uses rather odd, not so compatible glut headers, just look for glutInit(MS_LIB); and replace it with the glut initialization that you use.

fire.tiger
16-10-2006, 12:28 PM
Thanks,

Finally, I found correct OpenGL32.dll, GLU32.dll, glut.pas,
I can compile whole BOX.dpr project without any problems...
BUT, program itself, doesn't work..there is :

glutInit(MS_LIB);
glutInitDisplayMode(GLUT_DOUBLE or GLUT_RGBA or GLUT_DEPTH);
....

and glutInit(MS_LIB) returns false...so program jump to error...

do you know why ?
thanks

JernejL
16-10-2006, 04:51 PM
look into glutInit for what causes the error.

fire.tiger
17-10-2006, 05:55 AM
I got it...exactly these lines of code :

GLUTHandle:= LoadLibrary(MS_GLUT);
if (GLUTHandle > 0) then begin
LoadProcs;
Result:= True;
end;

and GlutHandle is zero...so it returns false in output...
but why it can't loadlibrary ??

thanks

JernejL
17-10-2006, 09:14 AM
I got it...exactly these lines of code :

GLUTHandle:= LoadLibrary(MS_GLUT);
if (GLUTHandle > 0) then begin
LoadProcs;
Result:= True;
end;

and GlutHandle is zero...so it returns false in output...
but why it can't loadlibrary ??

thanks

most likely it can't find the glut dll...

fire.tiger
17-10-2006, 10:27 AM
thanks a lot. it works fine now.

btw. very very nice piece of code...and dynamics simulation look
very nice.

btw2. do you think it would be hard to translate 2d algorithm to 3d ??
using opengl...

JernejL
17-10-2006, 07:02 PM
thanks a lot. it works fine now.

btw. very very nice piece of code...and dynamics simulation look
very nice.

btw2. do you think it would be hard to translate 2d algorithm to 3d ??
using opengl...

nice that you find it useful, i paid 40 Ǩ to translate it to pascal when i thought my game will use it, but i switched to newton physics engine later

i'm not sure if it would be hard to make it work in 3D, but i would recommend you look into Newton dynamics for 3D simulation first, it is very nice - www.physicsengine.com .

fire.tiger
17-10-2006, 08:05 PM
You paid 40 pounds to translate it from C to Pascal ? Really ?
Who did it, some company or person ?
I know newton engine...but it requires DLL that has to be distributed
with final EXE file...I prefer complete control in source code...
something like Unit...
But that code could be very good base for additional edits,
and improvements to make own physics engine..
how many physics engines do you know ?? I know just ODE and
Newton .. and commercial Havok...do you any other free or commercial ?

JernejL
18-10-2006, 09:07 AM
You paid 40 pounds to translate it from C to Pascal ? Really ?
Who did it, some company or person ?
I know newton engine...but it requires DLL that has to be distributed
with final EXE file...I prefer complete control in source code...
something like Unit...
But that code could be very good base for additional edits,
and improvements to make own physics engine..
how many physics engines do you know ?? I know just ODE and
Newton .. and commercial Havok...do you any other free or commercial ?

yeah, it was translated by lee_nover on our local delphi website - delphi-si.com. he also gives answers on experts-exchange.

newton can be binded into the exe using some library that i found on the internet, can't remember what it is called, people on newton forum should know.

i've tried several new physics, newton, true-axis, ode, and so far newton won in almost every aspect, and it is totally free.

fire.tiger
18-10-2006, 10:30 AM
So it is very nice that you add it here for free..if you paid 40 pounds..
I should say thank you, so Thank you .-)

So, newton DLL can be binded into EXE and nobody shouldn't know that it uses DLL newton ? But how about licensing..if we speak about commercial
projects?

Also, in which point do you think commercial physics engines are better than free engines ? for example what has Havok better than Newton ?

Also, do you know any fluid physics engines in pascal ?
or any algorithm about fluid or hydrodynamics...?

JernejL
18-10-2006, 12:17 PM
So it is very nice that you add it here for free..if you paid 40 pounds..
I should say thank you, so Thank you .-)

So, newton DLL can be binded into EXE and nobody shouldn't know that it uses DLL newton ? But how about licensing..if we speak about commercial
projects?

Also, in which point do you think commercial physics engines are better than free engines ? for example what has Havok better than Newton ?

Also, do you know any fluid physics engines in pascal ?
or any algorithm about fluid or hydrodynamics...?

here is the dll inside exe project:
http://www.basegraph.com/bg/tutorials/eng_tutor_dlltools/dlltools.html

newton is one of rare free dynamic engines, which is also free for commercial use, but it is closed source, which should not be a problem imo, it has very free usage license.

havok, hmm.. no idea what could it have better, it might be faster, but i'd guess newton would beat it in precision, also, it is worth mentioning that newton is so stable, that it is using euler integrator internally (believe it or not), while other engines would explode if they used euler.

i am not aware of any fluid physics simulations done in pascal, newton however has fluid simulation.

if you are interested into pascal & pascal physics engines, you may want to check out MPL licensed PAPPE (PAscal Powerful Physics Engine):
http://bero.0ok.de/blog/projects/pappe-pascal-powerful-physics-engine/

and TSS game (entire gta-like 3D game built with delphi, including own physics engine):
http://www.gtatools.com/tss/

fire.tiger
18-10-2006, 12:51 PM
That newton seems very interesting...

I've already found fluid mechanics source, but in C,
it wouldn't be problem for me to translate, but it uses
fast fourier transformations (fftw) in C, and this is rather .. well,
problem for me :) however it is algorithm that is base for such a
advanced fluid mechanics that is in Maya (Maya Fluid) if you know....

But I understand that hydrodynamics is very hard..I read that equations
of fluid mechanics were solved for almost fifty years...

I'm very interested in all kind of physics in computers..it's just a pitty that
I don't control advanced mathematics...:( that is so important for this kind of coding...

PAPPE is your pascal physics engine ? I've looked into link and tried
to download it via sourceforge, but sourceforge has written that there are no files...or something like that.

btw. what kind of fluid physics has newton ?

JernejL
18-10-2006, 01:09 PM
[quote="fire.tiger"]That newton seems very interesting...

I've already found fluid mechanics source, but in C,
it wouldn't be problem for me to translate, but it uses
fast fourier transformations (fftw) in C, and this is rather .. well,
problem for me :) however it is algorithm that is base for such a
advanced fluid mechanics that is in Maya (Maya Fluid) if you know....

But I understand that hydrodynamics is very hard..I read that equations
of fluid mechanics were solved for almost fifty years...

I'm very interested in all kind of physics in computers..it's just a pitty that
I don't control advanced mathematics...:( that is so important for this kind of coding...

PAPPE is your pascal physics engine ? I've looked into ]

no, pappe is not my work, i just stumbled upon it a while ago.

Oh, you are into actual liquid simulation? i'm not sure exactly what i could suggest you, as that is not really a popular area for game simulation. ODE and newton both support simple water plane with buoyancy, but no actual fluid dynamics.

i know for one thing, that novodex / aegia supported some fluid dynamics, not sure what happened to that.

fire.tiger
18-10-2006, 01:20 PM
Yes, I'm interested in precision physics computing...dynamics, simulations etc. If I'll translate that C source of fluid mechanics (under opengl) I'll give you info..but it is hard work..exactly fast fourier transformation...

also, do you know any good renderers ? radiosity / global illumination / photon mapping...with source ? :)

JernejL
18-10-2006, 01:40 PM
Yes, I'm interested in precision physics computing...dynamics, simulations etc. If I'll translate that C source of fluid mechanics (under opengl) I'll give you info..but it is hard work..exactly fast fourier transformation...

also, do you know any good renderers ? radiosity / global illumination / photon mapping...with source ? :)

hmm, not sure.. tried glscene?

fire.tiger
18-10-2006, 04:21 PM
of course :) I know glscene , who not :)

btw. and any IK engine, do you know ? I have already found radiosity renderer in delphi but...it's so slow....
really slow algorithm..I would need some faster :)

JernejL
18-10-2006, 05:23 PM
you mean inverse kinematics? newton is going to get them in some update, or so i heard.

fire.tiger
19-10-2006, 06:31 AM
yes I mean inverse kinematics, but I'm interested in algorithm, so it would be better for me to see some algorithm..or source code...don't you know any ?
As I see, newton has everything :-) fluid..ik engine, dynamics, has newton also cloth simulations and softbody sim. ?

JernejL
19-10-2006, 08:58 AM
yes I mean inverse kinematics, but I'm interested in algorithm, so it would be better for me to see some algorithm..or source code...don't you know any ?
As I see, newton has everything :-) fluid..ik engine, dynamics, has newton also cloth simulations and softbody sim. ?

newton does not have IK YET, but it is planned to have it in next release.
newton has only basic fluid (similar to ode), only useful to simulate water plane.

no cloth, since it has no particle system yet (but one is on the list) but you can make one yourself with raycasting. it has no soft bodies, and i'm not sure if it is planned at all.

fire.tiger
19-02-2007, 06:32 PM
Just a short info about dynamics :) I start to cooperate with mathematician
on profesional 3D fluid dynamics software, based on Navier Stokes equations. I'll inform you about it. It is pretty hard co it will take
some time 8)