|
|
Hello,
many many thanks Clipka & Alain for your advices
you just made my day :)
It's work now,
but I have some questions,
1. The control points are for me not clearly,What is the task of control point
in this macro? Why should I define a control point by [-1] and by [25]even if I
have frames from 0 to 24 (25 in my case)?
2.Can I define the spline points with a parameter? I mean for expl. if I want to
declare 50 frames(pictures), it will be take long time to type it for each
frame the declaration of points?
In my case, If I want to get the cars in following time in this position
1-Clock 0, <1,30,0,2.60] Start
2-Clock*1/8 <0,0,1.3>
3-clock*2/8 <-1.3,0,0>
4-clock*3/8 <0,0,-1.3>
5-clock*4/8 <1.3,0,0>
6-clock*5/8 <0,0,1.3>
7-clock*6/8 <-1.3,0,2.6>
8-clock*7/8 <0,0,3.9>
9-clock*8/8 <1.3,0,2.6> End
But 50 frames from clock 0 to clock 1.
How should I declare spline point cleverly, that I avoid to type 50 points?
(I have tried following defination for spline points
clock*50, <1.30*cos(2*pi*clock),0,2.60+1.3*sin(2*pi*clock)>
But it doesn't work, what I expected.
)
Many Thanks in advance for your advices
Yetkin
Alain <aze### [at] qwertyorg> wrote:
> > Hello,
> >
> > I have a problem by Povray, I am very new by Povray area
> > Maybe you can help me, It will be very nice.
> >
> > My problem is as following,
> >
> > I established a vehicle, which I would like on 8 form platform once racing in
> > Povray.
> > I used for it, the Spline_Trans macro from See Johansen.
> >
> > My problem is, the vehicle does not tracking the path
> > That I already defined
> >
> >
> > The following is mine povray code
> > Could you tell me please where did I made mistake?
> > -----
> > #include "colors.inc" // Defintion der Farben
> > #include "math.inc"
> > #include "transforms.inc"
> > background {color rgb<1,1,1>}
> >
> >
> >
> > camera
> > {
> > location< 0, 8, -20.0>
> > look_at<0, -0.8, 0>
> > angle 12
> > }
> >
> > light_source {< -30, 30, 0> color White }
> >
> >
> > //definition der Bahn
> > cylinder {
> > <0,-1.1,0>,<0,-1,0>, 2.1
> > texture { pigment { color Grey } }
> > }
> >
> >
> > cylinder
> > {
> > <0,-1.3,0>,<0,-1,0>, 0.77
> > texture { pigment { color Green }
> > }
> > }
> >
> >
> > cylinder {
> > <0,-1.1,2.6>,<0,-1,2.6>, 2.1
> > texture { pigment { color Grey } }
> > }
> >
> > cylinder
> > {
> > <0,-1.3,2.6>,<0,-1,2.6>, 0.77
> > texture { pigment { color Green }
> > }
> > }
> >
> >
> > #declare FahrzeugKoerper=
> >
> > box{<-0.3, -0.95, 1.0>,<0.2, -0.88, 1.3> texture { pigment {color rgb<2,
> > 0, 0>}}} ;
> >
> >
> > #declare reifen=
> > union
> >
> > {
> >
> > torus{0.05,0.018
> > texture{pigment {color rgb<5, 5, 5>}}} // rim - Felge
> >
> > torus{0.06,0.02
> > texture{pigment {color rgb<0, 0, 0>}}} // tire - Reifen
> > } ;
> >
> >
> >
> > #declare Fahrzeug=
> >
> > union
> > {
> >
> > object {FahrzeugKoerper}
> >
> >
> > object {reifen translate<0.10, 0.985, 0.925> rotate<90,0,0>} //Vorne Rechts
> >
> >
> > object {reifen translate<-0.20, 0.985, 0.925> rotate<90,0,0>} //Hinten Rechts
> >
> >
> > object {reifen translate<0.10, 1.315, 0.925> rotate<90,0,0>} //Vorne Links
> >
> >
> > object {reifen translate<-0.20, 1.315, 0.925> rotate<90,0,0>} //Hinten Rechts
> >
> > }
> >
> > #declare MySpline =
> > spline {
> >
> > cubic_spline
> >
> > -1,<0, 0, 0>, // control point
> > 0.00,<0.00,0.00,2.60>
> > 1.00,<0.45,0.00,2.50>
> > 2.00,<0.90,0.00,2.00>
> > 3.00,<1.30,0.00,1.30>
> > 4.00,<0.90,0.00,0.70>
> > 5.00,<0.45,0.00,0.30>
> > 6.00,<0.00,0.00,0.00>
> > 7.00,<-0.45,0.00,-0.30>
> > 8.00,<-0.90,0.00,-0.70>
> > 9.00,<-1.30,0.00,-1.30>
> > 10.00,<-0.90,0.00,-2.00>
> > 11.00,<-0.45,0.00,-2.50>
> > 12.00,<0.00,0.00,-2.60>
> > 13.00,<0.45,0.00,-2.50>
> > 14.00,<0.90,0.00,-2.00>
> > 15.00,<1.30,0.00,-1.30>
> > 16.00,<0.90,0.00,-0.70>
> > 17.00,<0.45,0.00,-0.30>
> > 18.00,<0.00,0.00,0.00>
> > 19.00,<-0.45,0.00,0.30>
> > 20.00,<-0.90,0.00,0.70>
> > 21.00,<-1.30,0.00,1.30>
> > 22.00,<-0.90,0.00,2.00>
> > 23.00,<-0.45,0.00,2.50>
> > 24.00,<0.00,0.00,2.60>
> > 25.00,<0.00,0.00,2.60>
> > }
> >
> > object { Fahrzeug Spline_Trans (MySpline, clock*25,<0,1,0>, 0.1, 0.00001) }
> >
> > -------------------
> > My ini file is;
> >
> > Antialias=On
> > Antialias_Threshold=0.2
> > Antialias_Depth=3
> >
> > Input_File_Name=backup.pov
> >
> > Initial_Frame=1
> > Final_Frame=25
> > Initial_Clock=0
> > Final_Clock=1
> >
> > Pause_when_Done=off
> > Cyclic_Animation=off
> >
> >
> > Thanks a lot in advance
> >
> > regards
> > Yetkin
> >
> > (Sorry for my English)
> >
> >
> I added the following to make your spline visible:
> #declare Spl_Pos = 0;
> union{
> #while(Spl_Pos <=25)
> sphere{MySpline(Spl_Pos)-1*y, 0.02}
> #declare Spl_Pos=Spl_Pos +1/4;
> #end
> pigment{rgb<1,1,0>}
> }
>
> If you do the same thing, you'll clearly see that your spline don't
> follow your track at all. It start and end in the center of the top loop
> and cross in the center of the botom one.
>
> You need to adjust your spline so that it follow the correct path.
> You need to create your "car" at the origin. You can place the center of
> the car or the mid point of it's rear axle at <0,0,0>.
> The bottom of the wheels should be at elevation zero.
> The left side should located at -Right_Side.
> Now, it goes from 1 to 1.3 while it MUST go from -0.15 to 0.15.
> Spline_Trans assume that your object front points toward +z. As your,s
> point toward +x, it looks like it's moving sideway.
> Same size, correct orientation, rear center at x=0, z=0:
> box{<-0.15, -0.95, 0.6>, <0.15, -0.88, 0>
>
> Change the controll point at -1 to <-0.45,0.00,2.50>
> Change the controll point at 25 to <0.45,0.00,2.50>
> This will ensure a smooth junction.
> It's never advisable to have a controll point at the same location as
> the neibouring point.
>
>
>
> Alain
Post a reply to this message
|
|