POV-Ray : Newsgroups : povray.animations : animation of two object Server Time
23 Nov 2024 20:11:13 EST (-0500)
  animation of two object (Message 1 to 4 of 4)  
From: scorpmetal
Subject: animation of two object
Date: 15 Mar 2005 09:25:00
Message: <web.4236ef8b42bd04a9fe7107b80@news.povray.org>
I want to make a mouvement of 2 objects different. And the camera look at
the center point in this mouvement. In this case, my 2 object is the cone
and the difference(cylinder and quadric). How I can make this? I hope you
understand my question!!! Thanks a lots

camera{
        location  < 0 , -2 , 0.0 >
        look_at   < 0 , 1.0 , 0.0 >
       }
difference{
        cylinder{
                 < 0, -0.4, 0 > , < 0, 2.5, 0 >, 4
                }
        quadric{
                < -1 , 1 , -1 >         //  A x^2  + B y^2  +  Cz^2
                < 0 , 0 , 0 >           //  D xy   + E xz   + F yz   +
                < 0 , 2.83 , 0 >        //  G x    + H y    + I z    +
                1                       //  J
                }
        texture {Mirror}
        translate <2,0,0>}
cone{
    <0,-1.5,0>,0,<0,-0.4,0>,0.2
    pigment {Black}
    translate <2,0 ,0>
    }


Post a reply to this message

From: Warp
Subject: Re: animation of two object
Date: 15 Mar 2005 09:35:07
Message: <4236f29b@news.povray.org>
scorpmetal <sco### [at] yahoocom> wrote:
> I want to make a mouvement of 2 objects different. And the camera look at
> the center point in this mouvement. In this case, my 2 object is the cone
> and the difference(cylinder and quadric). How I can make this? I hope you
> understand my question!!! Thanks a lots

  Just calculate the positions of the two objects using 'clock'?
Something along the lines of:

#declare Object1Position = <clock*10, 0, 0>;
#declare Object2Position = <-clock*5, 0, 0>;

camera { location <0,-2,0> look_at (Object1Position+Object2Position)/2 }

difference
{ whatever
  translate Object1Position
}

cone
{ whatever
  translate Object2Position
}

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Mike Williams
Subject: Re: animation of two object
Date: 15 Mar 2005 11:56:57
Message: <OWRAKFAOOxNCFwKg@econym.demon.co.uk>
Wasn't it scorpmetal who wrote:
>I want to make a mouvement of 2 objects different. And the camera look at
>the center point in this mouvement. In this case, my 2 object is the cone
>and the difference(cylinder and quadric). How I can make this? I hope you
>understand my question!!! Thanks a lots
>
>camera{
>        location  < 0 , -2 , 0.0 >
>        look_at   < 0 , 1.0 , 0.0 >
>       }
>difference{
>        cylinder{
>                 < 0, -0.4, 0 > , < 0, 2.5, 0 >, 4
>                }
>        quadric{
>                < -1 , 1 , -1 >         //  A x^2  + B y^2  +  Cz^2
>                < 0 , 0 , 0 >           //  D xy   + E xz   + F yz   +
>                < 0 , 2.83 , 0 >        //  G x    + H y    + I z    +
>                1                       //  J
>                }
>        texture {Mirror}
>        translate <2,0,0>}
>cone{
>    <0,-1.5,0>,0,<0,-0.4,0>,0.2
>    pigment {Black}
>    translate <2,0 ,0>
>    }
>

I'd suggest declaring the whole thing as a single union. The centre of
that pair of objects is approximately the centre of the bounding slab of
the union.

#declare THING = union {
  difference { ...
  cone {...
}

#declare CENTRE = (min_extent(THING)+max_extent(THING)) / 2;

camera {
  ...
  look_at CENTRE
}

Alternatively you could calculate the centres of the two parts in a
similar way and take the average of those two values.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: scorpmetal
Subject: Re: animation of two object
Date: 16 Mar 2005 03:40:00
Message: <web.4237efb127ac8165fe7107b80@news.povray.org>
Thanks. I will test your suggest.


Post a reply to this message

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