POV-Ray : Newsgroups : povray.binaries.animations : MegaPOV MechSim: Grouping & Gravity Server Time
19 Jul 2024 07:26:27 EDT (-0400)
  MegaPOV MechSim: Grouping & Gravity (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Tom Bates
Subject: MegaPOV MechSim: Grouping & Gravity
Date: 27 Jul 2003 23:39:38
Message: <3f249afa$1@news.povray.org>
Greetings Ladies and Gentlemen of the forum,

I have lately been experimenting with the MechSim feature
of MegaPOV 1.0.

I have created a somewhat complicated structure of masses
and connections that resembles a small animal.

I start it in the "air" and let it fall as the connections
reach a steady state of sorts by the time it lands on the
"ground".

However, I'm having a little difficulty with collision
detection and gravity.

"Huh?" you say.

I am attaching 4 test renders in follow-up messages to
this thread that should demonstrate my problem.

I am also attaching the source that produced the test
renders.

I have selected level 2 collision detection which is
supposed to detect collisions between components of
different groups, but not within the same group.

In the first, Test2-0.mpg, no grouping was done, and the
objects are not connected.  This works as expected.

In the second, Test2-1.mpg, the objects are separated into
groups, and they are still not connected.  This works as
expected.

In the third, Test2-2.mpg, no grouping was done, and the
objects are connected.  This works as expected.

In the fourth, Test2-3.mpg, the objects are separated into
groups, and the objects are connected.  This does not work
as expected.  For some reason, it seems that this
arrangement affects the objects response to gravity.

I'm wondering is this a bug?  a feature?  or something
that I'm missing?

I would be extremely grateful if someone could enlighten
me as to what I need to do.  If you need more information
than what I've provided here, please let me know.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-0.mpg - 490 KB)
Date: 27 Jul 2003 23:41:57
Message: <3f249b85@news.povray.org>
In the first, Test2-0.mpg, no grouping was done, and the
objects are not connected.  This works as expected.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message


Attachments:
Download 'Test2-0.mpg' (491 KB)

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-1.mpg - 490 KB)
Date: 27 Jul 2003 23:43:34
Message: <3f249be6@news.povray.org>
In the second, Test2-1.mpg, the objects are separated into
groups, and they are still not connected.  This works as
expected.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message


Attachments:
Download 'Test2-1.mpg' (491 KB)

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-2.mpg - 490 KB)
Date: 27 Jul 2003 23:44:25
Message: <3f249c19@news.povray.org>
In the third, Test2-2.mpg, no grouping was done, and the
objects are connected.  This works as expected.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message


Attachments:
Download 'Test2-2.mpg' (491 KB)

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-3.mpg - 490 KB)
Date: 27 Jul 2003 23:45:41
Message: <3f249c65@news.povray.org>
In the fourth, Test2-3.mpg, the objects are separated into
groups, and the objects are connected.  This does not work
as expected.  For some reason, it seems that this
arrangement affects the objects response to gravity.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message


Attachments:
Download 'Test2-3.mpg' (491 KB)

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2.pov - 6 KB)
Date: 27 Jul 2003 23:56:51
Message: <3f249f03@news.povray.org>
I am attaching the source that produced the test renders.

The same file produced all four renders.

I simply changed the TestNum variable in the following lines:

#local  TestNum   = 3;
#local  DOGROUP   = div(mod(TestNum,2),1);  //  <<--  the first bit
#local  DOCONNECT = div(mod(TestNum,4),2);  //  <<--  the second bit

This test file is a stripped copy of my full project file.

Thank you,

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message


Attachments:
Download 'Test2.pov.txt' (7 KB)

From: Rick [Kitty5]
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-3.mpg - 490 KB)
Date: 28 Jul 2003 13:52:53
Message: <3f2562f5@news.povray.org>
Tom Bates wrote:
> In the fourth, Test2-3.mpg, the objects are separated into
> groups, and the objects are connected.  This does not work
> as expected.  For some reason, it seems that this
> arrangement affects the objects response to gravity.

does it only effect this arrangement?

(nice series btw, appreciate you posting all of them)

-- 
Rick

Kitty5 NewMedia http://Kitty5.com
POV-Ray News & Resources http://Povray.co.uk
TEL : +44 (01270) 501101 - ICQ : 15776037

PGP Public Key
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA


Post a reply to this message

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-3.mpg - 490 KB)
Date: 28 Jul 2003 14:03:09
Message: <3f25655d$1@news.povray.org>
Rick [Kitty5] wrote:
> Tom Bates wrote:
> > In the fourth, Test2-3.mpg, the objects are separated into
> > groups, and the objects are connected.  This does not work
> > as expected.  For some reason, it seems that this
> > arrangement affects the objects response to gravity.
>
> does it only effect this arrangement?

Yes.  It seems that the gravity disappears (or is greatly
diminished) only when the objects are grouped and then
connections made between them.

I haven't tried using the other simulation method of detecting
collisions between all elements and not using groups.
I'll try that next to see if that will work.

I'm still curious why this is happening though.

>
> (nice series btw, appreciate you posting all of them)

Thank you.  I spent a lot of time isolating the conditions of
this problem.  I was hoping to make those conditions clear
in my post.

>
> --
> Rick

Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message

From: Tom Bates
Subject: Re: MegaPOV MechSim: Grouping & Gravity (Test2-3.mpg - 490 KB)
Date: 28 Jul 2003 16:33:50
Message: <3f2588ae@news.povray.org>
Yes, I'm replying to myself.

Tom Bates wrote:
> Rick [Kitty5] wrote:
> > Tom Bates wrote:
> > > In the fourth, Test2-3.mpg, the objects are separated into
> > > groups, and the objects are connected.  This does not work
> > > as expected.  For some reason, it seems that this
> > > arrangement affects the objects response to gravity.
> >
> > does it only effect this arrangement?
>
> Yes.  It seems that the gravity disappears (or is greatly
> diminished) only when the objects are grouped and then
> connections made between them.
>
> I haven't tried using the other simulation method of detecting
> collisions between all elements and not using groups.
> I'll try that next to see if that will work.

Ok, I removed the grouping, and tried collision method 1
(MECHSIM_COLLISION_ALL) "Collisions between all
simulation elements are calculated."  The results are
exactly the same as grouping the objects and using
collision method 2 (MECHSIM_COLLISION_GROUP)
"Only collisions between elements of different groups
are calculated."

So, that means that this problem is not a problem with
grouping, but a problem with collision detection and the
way I have my objects connected.

This is too bad, because I really need to connect my
objects that way.


Tom Bates

--
#macro T(B)#local m=mod(B,8);#local B=floor(B/8);m#end#local C=126981491245202;#
local D=115694168992822;sphere_sweep{b_spline 16#local i=0;#while(i<16)<T(C)-4,T
(D)-4,10-i/10>.1#local i=i+1;#end pigment{rgb 1}}light_source{-10,1} //Tom Bates


Post a reply to this message

From: Mike Williams
Subject: MegaPOV MechSim: Grouping & Gravity (Test2-3.mpg - 490 KB)
Date: 28 Jul 2003 16:58:23
Message: <HuwtVOAb4YJ$EwPD@econym.demon.co.uk>
Wasn't it Tom Bates who wrote:
>In the fourth, Test2-3.mpg, the objects are separated into
>groups, and the objects are connected.  This does not work
>as expected.  For some reason, it seems that this
>arrangement affects the objects response to gravity.

Here are some thoughts about what might be going on.

I've had experience whereby if two connected masses become closer than the sum
of their radii, then they can get stuck in mid air.

When you're using the connections, then these lines try to cause two masses of
radius 0.1 to be 0.1 units apart, and might have something to do with it.

connection { mEnd - 2, mStart+ 2 stiffness Stiff  damping Damp length 0.1}
connection { mEnd - 1, mStart+ 3 stiffness Stiff  damping Damp length 0.1}

I can't seem to fix it by increasing the connection length in your example,
but I can remove the "getting stuck in mid air" effect by reducing the radii
of the masses (including those in the grid) to 0.01 and raising the density to
1000000 to keep their mass the same. Unfortunately, it then seems to miss some
of the collisions, and the bones interpenetrate - I can't help you with that
effect. 

Here's a simple topology that exhibits getting stuck in mid air only if groups
and connections are switched on:

      topology {

         #if (DOGROUP) group { #end
            mass { <0,2,0>, 0, 0.1 density Dense }          
            mass { <1,2,0>, 0, 0.1 density Dense }          
            connection { 0, 1 stiffness Stiff damping Damp }
         #if (DOGROUP) } #end

         #if (DOGROUP) group { #end
            mass { <0,1,1>, 0, 0.1 density Dense }          
            mass { <1,1,1>, 0, 0.1 density Dense }          
            connection { 2, 3 stiffness Stiff damping Damp }
         #if (DOGROUP) } #end

         #if (DOCONNECT)
            connection { 1, 2 stiffness Stiff damping Damp length 0.15}
         #end

        save_file "test2.dat" 3
      }

* All constants as per Tom's original file.
* Because there are no faces, use this to display the object
        MechSim_Show_All_Objects(-1, false, -1, "")

If you vary the length, then at about length 0.184 you'll find that the object
hits the ground before the connection manages to get the masses close enough
to get stuck.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.