Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ALife , Sodaplay & Springs  (Read 2338 times)
0 Members and 1 Guest are viewing this topic.
Offline rdlecler

Senior Newbie




Java games rock!


« Posted 2004-07-20 16:06:07 »

My research is in ALife and I have used ODE and Vortex so I have some familiarity with physics engines. Currently I am looking to move away from "joint" driven creatures to "spring" driven creatures. An example of this are the creatures of sodayplay: http://www.sodaplay.com/.

I am hoping someone might be able to give me some advice on this before I begin to tackle this problem. It seems to me that slider joints would be insufficient and ODE doesn't seem to have "multi-point tension spring" which seem to be what is used in Sodayplay (http://www.sodaplaycentral.com/articles/tension1.php)

I would be *very* interested in hearing anything anyone would have to offer on this.

Thanks,
RDL
Offline boid

Senior Newbie




I love YaBB 1G - SP1!


« Reply #1 - Posted 2004-07-20 20:20:45 »

There is a new java.net article on this particular subject:

"Making Fluid 3D Creatures with JOGL"
http://today.java.net/pub/a/today/2004/07/20/fluidiom.html

... and for the graphics people check out this "photon soup" renderer in java:

http://www.cpjava.net/photonproj.html
Offline rdlecler

Senior Newbie




Java games rock!


« Reply #2 - Posted 2004-07-21 17:56:14 »

Thanks. That is pretty interesting. I am looking over the source code now to see if it would be easier to use java ODE or try to integrate this.

Oh, one more thing. If I was to implement this in odejava would I need to use the lowlevel api or would there be enough there to use the highlevel api?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-07-21 21:55:42 »

The highlevel API is basically an O-O wrapper for the low level API.  It's even possible to mix and match (with care).  I would recommend using the High Level API.  If there is anything missing or that could be done better, code it and send us the diff Smiley

Will.

Offline Vikstar

Senior Newbie





« Reply #4 - Posted 2004-07-22 15:11:07 »

You can apply forces to bodies at positions relative to those bodies. Such positions would correspond to the points where the spring attaches itself to the body. Use the low level api, namely Ode.dBodyGetRelPointPos, to transform each attachment point of a spring to global coordinates. You can then find the length of the spring based on these two points, and use it in your spring equation.

Once you have the force from the spring equation, you simply get a vector from one attachment point to the other, normalise and then scale by the amount of force induced by the spring. Add the forces to each body relative to the attachment points.

Here is a prototype solution for converting a point from body space to global space:

 public static void getBodyToWorldPoint(Body body, Tuple3f inBodyPoint, Tuple3f outWorldPoint)
 {
   SWIGTYPE_p_float _pf = Ode.new_floatArray(3);
   Ode.dBodyGetRelPointPos(body.getBodyId(), inBodyPoint.x, inBodyPoint.y, inBodyPoint.z, _pf);
   outWorldPoint.x = Ode.floatArray_getitem(_pf, 0);
   outWorldPoint.y = Ode.floatArray_getitem(_pf, 1);
   outWorldPoint.z = Ode.floatArray_getitem(_pf, 2);
   Ode.delete_floatArray(_pf);
 }
Offline rdlecler

Senior Newbie




Java games rock!


« Reply #5 - Posted 2004-07-22 17:44:47 »

One thing I am thinking about with the "standard" spring solution is that this is a "cellular" system and not a particle system and I would like the "springs" to act kind of like muscles. One thing I noticed with regular springs implementations is that if I have something like a box, where each vertex is a point and each edge is a spring you also need to apply springs on the cubes diameter so that it doesn't collapse.

Joints are different however because they kind of weld the connecting objects along an axis. I would like to keep that (doesn't matter if they spin) but I would like them to have some push-pull flexibility as well as some "bending" capability.

Thanks
RDL
Offline rdlecler

Senior Newbie




Java games rock!


« Reply #6 - Posted 2004-07-22 17:48:05 »

P.S. I am on a bit of a tight deadline her as I am trying to get my implementation in a suitible form as I would like to show what I have to some people at the upcomming alife conference.

That said, if anyone wants to make some extra money I would gladly pay because I know this is going to take me awhile to figure out!

Thanks,
RDL
Offline Vikstar

Senior Newbie





« Reply #7 - Posted 2004-07-23 06:24:40 »

Quote
One thing I am thinking about with the "standard" spring solution is that this is a "cellular" system and not a particle system and I would like the "springs" to act kind of like muscles. One thing I noticed with regular springs implementations is that if I have something like a box, where each vertex is a point and each edge is a spring you also need to apply springs on the cubes diameter so that it doesn't collapse.

Joints are different however because they kind of weld the connecting objects along an axis. I would like to keep that (doesn't matter if they spin) but I would like them to have some push-pull flexibility as well as some "bending" capability.

Thanks
RDL


To keep the springs from being loose, all you have to do is add not only a force as in the regular spring impl, but also a torque at the point where the spring is attached to a body.

When you setup your physical model, save the vector direction or "normal" that the spring attaches to each body. Then after each step calculate the actual vector between the spring's two attachements points, and using the saved vector, you can apply an appropriate torque which will try to twist the bodies back into allignment.
Offline fluxe

Junior Newbie




Java games rock!


« Reply #8 - Posted 2004-09-22 10:23:44 »

there's another topic here related to spring-based creatures.  they've actually been evolved with a simple genetic algorithm to run like the wind. Smiley

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1095590540

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (30 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!