POV-Ray : Newsgroups : povray.advanced-users : Fishtail math ><}}}*> Server Time
30 Jul 2024 12:32:33 EDT (-0400)
  Fishtail math ><}}}*> (Message 11 to 20 of 26)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 6 Messages >>>
From: ingo
Subject: Re: Fishtail math ><}}}*>
Date: 19 Nov 1999 17:52:36
Message: <8E83FDBF4seed7@212.120.113.81>
Peter Popov wrote:

>//try this
>
>#declare Pos=array[11]
>
>#declare i=0;
>#while (i<11) #declare Pos[i]=<i,0,0>; #declare i=i+1; #end
>
>#declare i=1;
>#while (i<11)
>  #declare Pos[i]=vrotate((Pos[i]-Pos[i-1]),<0,0,10*clock>)+Pos[i-1];
>  #declare i=i+1;
>#end

No, I'm afraid that's not what I'm looking for. What I expected to see is 
the spheres arranged in a arc, about one quarter of a circle.

mmm, all spheres end up on a circle, the length of the arcsegment between 
two spheres is known (1 in this case). The angle between the two vectors 

circle will always go through the origin, where the first sphere is.
With this, I think the radius and centerposition of the circle can be 
calculated. Once this circle is known, take the distance frome any sphere 
on the x-axis to the origin. Take an arcsegment of the circle with the same 
length and put the sphere there.
Would it work? I'll sleep over this and try if I can figure it out 
tomorrow.

Thanks Peter for your effort.

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Peter Popov
Subject: Re: Fishtail math ><}}}*>
Date: 19 Nov 1999 19:04:52
Message: <4OM1ONJO3=BUzyt4OW6oH853Ryf2@4ax.com>
On 19 Nov 1999 17:52:36 -0500, ing### [at] homenl (ingo) wrote:

>No, I'm afraid that's not what I'm looking for. What I expected to see is 
>the spheres arranged in a arc, about one quarter of a circle.
>
>mmm, all spheres end up on a circle, the length of the arcsegment between 
>two spheres is known (1 in this case). The angle between the two vectors 

>circle will always go through the origin, where the first sphere is.
>With this, I think the radius and centerposition of the circle can be 
>calculated. Once this circle is known, take the distance frome any sphere 
>on the x-axis to the origin. Take an arcsegment of the circle with the same 
>length and put the sphere there.
>Would it work? I'll sleep over this and try if I can figure it out 
>tomorrow.
>
>Thanks Peter for your effort.
>
>Ingo

I got your intentions wrong. This should do what you want, as
described in your original post.

#declare Pos=array[11]

#declare i=0;
#while (i<11) #declare Pos[i]=<i,0,0>; #declare i=i+1; #end

#declare i=0;
#while (i<10)
  #declare j=i+1;
  #while (j<11)
    #declare Pos[i]=
    vrotate((Pos[j]-Pos[i]),<0,0,10*clock>)+Pos[i];
    #declare j=j+1;
  #end
  #declare i=i+1;
#end

If it doesn't, I'll look at it tomorrow.


Peter Popov
ICQ: 15002700


Post a reply to this message

From: Remco de Korte
Subject: Re: Fishtail math ><}}}*>
Date: 19 Nov 1999 19:38:49
Message: <3835ED87.8C910B8E@xs4all.nl>
ingo wrote:
> 
> >How much stress will that cause?
> >And you're not telling me that you've never had to stretch while
> moving
> >haven't you?
> >Anyway, it's probably bad physics for a robot, but it works (for me)
> in
> >an image.
> 
> That's true, but it's like YKYHBRTLW You create a motor using every
> part
> ..... even the ones that don't show ..... just for authenticity.
> 
> Ingo
> 
> --
> Photography: http://members.home.nl/ingoogni/
> Pov-Ray    : http://members.home.nl/seed7/

I was obviously missing the point.
I would suggest a recursive macro.

Remco


Post a reply to this message

From: ingo
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 04:13:41
Message: <8E8465C1Eseed7@212.120.113.81>
Peter Popov wrote:

>I got your intentions wrong. This should do what you want, as
>described in your original post.
>
>#declare Pos=array[11]
>
>#declare i=0;
>#while (i<11) #declare Pos[i]=<i,0,0>; #declare i=i+1; #end
>
>#declare i=0;
>#while (i<10)
>  #declare j=i+1;
>  #while (j<11)
>    #declare Pos[i]=
>    vrotate((Pos[j]-Pos[i]),<0,0,10*clock>)+Pos[i];
>    #declare j=j+1;
>  #end
>  #declare i=i+1;
>#end

Sorry but no, ten spheres end up at <10,0.9,0> and one at <10,0,0>.

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 07:21:18
Message: <38369190.12D9F64F@my-dejanews.com>
I think there is a more serious problem with the sin cos solution.

The sin cos solution prevents non unique positions along the x axis.  Many
kinds of aquatic animals, maybe some fish, would bend their bodies around so
much that there might be two points of the body at some given x.

Remco de Korte wrote:

> ingo wrote:
> >
> > I'm trying to animate the tail of an ASCII-fish. I figured out how to
> > do it
> > the long way but I'm looking for a short cut.
> >
> > Concider eleven spheres on a string from the origin to <10,0>.


> > around the current position of the second sphere.
> > 3. leave the first and second sphere in its position. rotate the whole

> > .
> > .
> > .

> > tenth
> > sphere.
> >
> > Now, is there a direct way to calculate the position of a sphere,
> > without
> > going through the above loop. What will the position of sphere 7 be
> > when

> >
> > Ingo
> >
> > --
> > Photography: http://members.home.nl/ingoogni/
> > Pov-Ray    : http://members.home.nl/seed7/
>
> I don't know if I understand your method exactly but I did a similar
> thing with a reasonable result using sin/cos-functions. This gives a
> nice curve. The position of each sphere is based on its place in the
> string _plus_ a clock value. This way the first sphere will move also.
> This is easy to avoid by moving the whole string relative to the
> translation of this first sphere. Sounds far more complicated then it
> actually is 8)
>
> Groeten!
>
> Remco


Post a reply to this message

From: ingo
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 07:43:44
Message: <8E8487412seed7@212.120.113.81>
ingo wrote:

>mmm, all spheres end up on a circle, the length of the arcsegment
>between two spheres is known (1 in this case)........

Got it, I think:

#declare Pos=array[11]

#declare i=0;
#while (i<11) 
   #declare Pos[i]=<i,0,0>; 
   #declare i=i+1; 
#end

#declare Angle   = radians(10*clock);
#declare Length  = Pos[1].x-Pos[0].x;
#declare Radius  = Length/Angle;
#declare Lcord   = (Radius/sin(0.5*pi-(Angle/2)))*sin(Angle);
#declare Ccenter = <-0.5*Lcord, Radius, 0>;

#declare i=0;
#while (i<11)
   #if (Pos[i].x=0)
      // do nothing
   #else
      #declare L= Pos[i].x;
      #declare Alpha= L/Radius;
      #declare Pos[i]=
(vrotate(<0,-radius,0>,<0,0,degrees(Alpha)>))+Ccenter;
   #end
   #declare i=i+1; 
#end

#declare i=0;
#while (i<11) 
   sphere{ Pos[i],0.2 pigment {rgb <1,0,0>}}
   #declare i=i+1; 
#end


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: TonyB
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 07:48:09
Message: <38369889@news.povray.org>
This just crashed my UVPOV during the creation of the bounding slabs. It
said something about Reallocing Finite to 33...


Post a reply to this message

From: ingo
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 08:04:52
Message: <8E84859B8seed7@212.120.113.81>
TonyB wrote:

>This just crashed my UVPOV during the creation of the bounding slabs. It
>said something about Reallocing Finite to 33...
>

Ooops, posted it a bit too ethousiastic.
Add after the #declare Angle statement
#if (Angle !=0)
   and before the last #declare i=0
#end

Also the x-coordinate value of Ccenter seems to be not ok yet.


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Remco de Korte
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 08:52:48
Message: <3836A79B.6502BDE8@xs4all.nl>
Greg M. Johnson wrote:
> 
> I think there is a more serious problem with the sin cos solution.
> 
> The sin cos solution prevents non unique positions along the x axis.
> Many
> kinds of aquatic animals, maybe some fish, would bend their bodies
> around so
> much that there might be two points of the body at some given x.
> 
> Remco de Korte wrote:
> 

I don't understand. This is just the thing that makes sin or cos a
reasonable choice, I thought. 
I'm obviously missing something very important here. The only thing that
I have to support my choice is a working animation that does what it
should do for me, but, admittedly, is probably not what a hardcore
pov-er would consider realistic.

Regards,

Remco


Post a reply to this message

From: ingo
Subject: Re: Fishtail math ><}}}*>
Date: 20 Nov 1999 09:27:18
Message: <8E849EBDBseed7@212.120.113.81>
Remco de Korte wrote:

>Greg M. Johnson wrote:
>> 
>> I think there is a more serious problem with the sin cos solution.
>> 
>> The sin cos solution prevents non unique positions along the x axis.
>> Many
>> kinds of aquatic animals, maybe some fish, would bend their bodies
>> around so
>> much that there might be two points of the body at some given x.
>> 
>> Remco de Korte wrote:
>> 
>
>I don't understand. This is just the thing that makes sin or cos a
>reasonable choice, I thought.......

For a simple fishtail you're right. But sometimes it's a sport doing thing 
a certain way. Run a 60 frame animation of the below scene (~5 minutes), it 
shows what Greg means.

#version 3.1;
global_settings {assumed_gamma 1.0}
light_source {
   < 500, 500,-500>
   rgb 1
}
camera {
   location  <4, 0, -10>
   look_at   <4, 0.0,0.0>
   angle 90
}
// generates number between min & max
// based on Value between 0, 1.
#macro Vmm(Min,Max,Value)
   (Min+((Max-Min)*Value))
#end //macro

#declare Pos=array[150]

#declare i=0;
#while (i<150) 
   #declare Pos[i]=<i/10,0,0>; 
   #declare i=i+1; 
#end

#declare Angle   = radians(Vmm(-4,4,clock));
#if (Angle !=0)
   #declare Length  = Pos[1].x-Pos[0].x;
   #declare Radius  = Length/Angle;
   #declare Ccenter = <0, Radius, 0>;
   
   #declare i=0;
   #while (i<150)
      #if (Pos[i].x=0)
         // do nothing
      #else
         #declare L= Pos[i].x;
         #declare Alpha= L/Radius;
         #declare Pos[i]=
(vrotate(<0,-Radius,0>,<0,0,degrees(Alpha)>))+Ccenter;
      #end
      #declare i=i+1; 
   #end
#end

#declare i=0;
#while (i<150) 
   sphere{ Pos[i],0.3 pigment {rgb <1,0,0>}}
   #declare i=i+1; 
#end


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 6 Messages >>>

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