POV-Ray : Newsgroups : povray.newusers : animation help Server Time
5 Nov 2024 05:26:18 EST (-0500)
  animation help (Message 1 to 7 of 7)  
From: Ace
Subject: animation help
Date: 18 Dec 2001 09:14:04
Message: <3c1f4f2c@news.povray.org>
Hello,

OK, I have a wheel that I need to turn on an axel, while the axel, wheel and
the whole car move. can  I make the axel the center of the wheel some how?
so that I can rotate it 360+ degrees while it moves?

Gary


Post a reply to this message

From: Simon Adameit
Subject: Re: animation help
Date: 18 Dec 2001 13:16:34
Message: <3c1f8802@news.povray.org>
> Hello,
>
> OK, I have a wheel that I need to turn on an axel, while the axel, wheel
and
> the whole car move. can  I make the axel the center of the wheel some how?
> so that I can rotate it 360+ degrees while it moves?
>
You could first rotate the wheel and then translate it.


Post a reply to this message

From: bob h
Subject: Re: animation help
Date: 18 Dec 2001 13:55:33
Message: <3c1f9125@news.povray.org>
"Ace" <ble### [at] icefognet> wrote in message
news:3c1f4f2c@news.povray.org...
> Hello,
>
> OK, I have a wheel that I need to turn on an axel, while the axel, wheel
and
> the whole car move. can  I make the axel the center of the wheel some how?
> so that I can rotate it 360+ degrees while it moves?

If all your asking is for the way a typical vehicle rolls along on wheels
attached to a axle then yes, pretty simple to do.

You want the circumference of the wheel to match distance on the ground
plane.

(Radius*2)*pi=Distance

Radius being POV units of the wheel, Distance being the movement of the
whole car.  So all you really are doing is finding that distance of travel
via the wheel size.  So when you put translate Distance*clock*x into the Car
object statement you get that amount of travel.

Then for multiple turns of the wheel you simply add a extra variable for how
many times to turn it.  Complete setup as follows:

light_source {
  0,1.5
  translate <-20, 20, -20>
}

plane {y,0 pigment {gradient x}}

#declare Number=2*clock; // number of wheel turns, animated

#declare Turns=360*Number; // convert to degrees

#declare Major=0.75; // the wheel size
#declare Minor=0.25; // the tire size
#declare Radius=Major+Minor; // these total Radius

#declare Distance=Number*(Radius*2)*pi; // amount of travel

#declare Tire=
torus {Major,Minor // 1 unit radius
        pigment {leopard
                color_map {
                        [0.5 rgb 0][0.5 rgb 1]
                } scale 0.1
        }
         rotate 90*x // orient for y plane ground
}

#declare Wheel=
union {
        object {Tire}
        disc {0,z,Major,Minor
                pigment {rgb <0,1,1>}
                translate -0.125*z
        }
}

#declare Axle=
cylinder {-z,z,0.125
        pigment {rgb <1,1,1>}
}

#declare Body=
box {-1,1
        pigment {rgb <1,1,0>}
         scale <4,1,1.5>
}

#declare Car=
union {
    object {Wheel
         rotate -Turns*z
             translate <-2.5,1,-1.5>}
    object {Axle
         scale <1,1,1.75>
             translate <-2.5,1,0>}
    object {Body
         translate <0,1.5,0>}
translate Distance*x // move across screen to +x
}

object {Car}

camera {
  location  <0, 2, -10>
  look_at   <Distance, 1, 0>
  right     x*image_width/image_height
}


You'll need to put it all together as wanting, texturing and objects.  I
might have gone too far writing up a whole scene here  :-)  without knowing
for certain your question.  It sounded like you either had trouble with
origin rotations or motion along direction of movement.  Hopefully this will
answer both things.


Post a reply to this message

From: Ace
Subject: Re: animation help
Date: 18 Dec 2001 20:36:18
Message: <3c1fef12@news.povray.org>
bob h <omn### [at] charternet> wrote in message
news:3c1f9125@news.povray.org...
>
> If all your asking is for the way a typical vehicle rolls along on wheels
> attached to a axle then yes, pretty simple to do.
>
> You want the circumference of the wheel to match distance on the ground
> plane.
>
> (Radius*2)*pi=Distance
>
> Radius being POV units of the wheel, Distance being the movement of the
> whole car.  So all you really are doing is finding that distance of travel
> via the wheel size.  So when you put translate Distance*clock*x into the
Car
> object statement you get that amount of travel.
>
> Then for multiple turns of the wheel you simply add a extra variable for
how
> many times to turn it.  Complete setup as follows:
>
<snip great scene>
>
> You'll need to put it all together as wanting, texturing and objects.  I
> might have gone too far writing up a whole scene here  :-)  without
knowing
> for certain your question.  It sounded like you either had trouble with
> origin rotations or motion along direction of movement.  Hopefully this
will
> answer both things.
>
yes thats what I wanted, I think :-) just not sure how to use it...
All I really need is how to make the wheel turn around its center instead of
the center of the car.... I want to declare the axel as the center of the
wheel.I posted 2 example in the animation group.one without the wheels
turning, one with them turning. ignore the fact that the wheels are square
;-) sorry they run so fast.....

Gary


Post a reply to this message

From: bob h
Subject: Re: animation help
Date: 19 Dec 2001 04:39:52
Message: <3c206068@news.povray.org>
Ahhh yes, I see you have them offset from the tires.  Should only be a case
of translating them to origin then rotating and translating back again, or
easier still rotate first then place them.

"Ace" <ble### [at] icefognet> wrote in message
news:3c1fef12@news.povray.org...
>
> yes thats what I wanted, I think :-) just not sure how to use it...

Since your car flies all that might be more than needed  ;-)

> All I really need is how to make the wheel turn around its center instead
of
> the center of the car.... I want to declare the axel as the center of the
> wheel.I posted 2 example in the animation group.one without the wheels
> turning, one with them turning. ignore the fact that the wheels are square
> ;-) sorry they run so fast.....

Yep, very difficult to watch.
Like I said, all you have to do is get the axles (axel is Middle English
apparently) on the origin <0,0,0> before rotating, as long as that step is
done and then they are translated to final position (unioned with car)
things should work as expected.

If you'd like to post that part of your animation script here it's easily
fixable if you can't get it right yourself.  But that's probably all you
need to know.  At least now you can also match the tires to the ground if
you wanted to do so... flat ground anyhow.
--
text{ttf"timrom""bob h"0,0pigment{rgb 7}translate 7*z}


Post a reply to this message

From: Ace
Subject: Re: animation help
Date: 19 Dec 2001 09:05:43
Message: <3c209eb7@news.povray.org>
I found my problem! when you said translate to origin, I got it!

this was a file created by converting another type of model.
it declared the wheel when it was created, then used it in a union to make
the car,I was rotating it in the union, thus it rotated on the center of the
whole car! If I rotate it when its created it turns on its own axis!

YIPPIIIII!!!!!
Thank You! Thank You! Thank You!
Gary

bob h <omn### [at] charternet> wrote in message
news:3c206068@news.povray.org...
> Ahhh yes, I see you have them offset from the tires.  Should only be a
case
> of translating them to origin then rotating and translating back again, or
> easier still rotate first then place them.
>
> "Ace" <ble### [at] icefognet> wrote in message
> news:3c1fef12@news.povray.org...
> >
> > yes thats what I wanted, I think :-) just not sure how to use it...
>
> Since your car flies all that might be more than needed  ;-)
>
> > All I really need is how to make the wheel turn around its center
instead
> of
> > the center of the car.... I want to declare the axel as the center of
the
> > wheel.I posted 2 example in the animation group.one without the wheels
> > turning, one with them turning. ignore the fact that the wheels are
square
> > ;-) sorry they run so fast.....
>
> Yep, very difficult to watch.
> Like I said, all you have to do is get the axles (axel is Middle English
> apparently) on the origin <0,0,0> before rotating, as long as that step is
> done and then they are translated to final position (unioned with car)
> things should work as expected.
>
> If you'd like to post that part of your animation script here it's easily
> fixable if you can't get it right yourself.  But that's probably all you
> need to know.  At least now you can also match the tires to the ground if
> you wanted to do so... flat ground anyhow.
> --
> text{ttf"timrom""bob h"0,0pigment{rgb 7}translate 7*z}
>
>
>


Post a reply to this message

From: bob h
Subject: Re: animation help
Date: 19 Dec 2001 09:23:53
Message: <3c20a2f9@news.povray.org>
"Ace" <ble### [at] icefognet> wrote in message
news:3c209eb7@news.povray.org...
> I found my problem! when you said translate to origin, I got it!
>
> this was a file created by converting another type of model.
> it declared the wheel when it was created, then used it in a union to make
> the car,I was rotating it in the union, thus it rotated on the center of
the
> whole car! If I rotate it when its created it turns on its own axis!
>
> YIPPIIIII!!!!!
> Thank You! Thank You! Thank You!


Glad I could be overly helpful Gary!  Yeah, the golden rule in POV-Ray
concerning rotation is start at the origin to revolve and start offset from
origin to orbit.  Watch out when scale and translate are used too or you
might get unexpected results.
--
text{ttf"timrom""bob h"0,0pigment{rgb 7}translate 7*z}


Post a reply to this message

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