POV-Ray : Newsgroups : povray.animations : camera problems Server Time
18 Jun 2024 08:21:43 EDT (-0400)
  camera problems (Message 1 to 3 of 3)  
From: sHURAKAI
Subject: camera problems
Date: 23 Aug 2004 08:50:00
Message: <web.4129e79b9db258e96b3522e90@news.povray.org>
after solving the last problem with your nice #switch i now have another
problem. I created a cameraspline using the spline.mcr but as already
mentioned in in another post, the look_at point moves with the movement of
the camera or even more worse, the camera looks in the moving direction.
But i need to have it focused to a single point. Or even better i would
like to create another spline for the look_at. Is it possible ? Sorry but
i'm still a noob in creating animations.

The path and the camera.

#declare Path = create_spline (
   array[10] {<   0,  0, 10>,
             < -10,  0,  0>,
             <   0, 10,  0>,
             <  10,  0,  0>,
             <   0,  0,-10>,
             < -10,  0,  0>,
             <   0,  0, 10>,
             <  10,  0,  0>,
             <   0,  0,-10>,
             < -10,  0,  0> },
   spline_loop (yes) + spline_tension (-1))
   preview_spline (Path, default_options)


#declare CAM_motion =   camera {right -4/3*x up y
                        angle 45.000000
                        location < 0.01, 0, 0 >
                        look_at <0,0,0>
                        animate_by_spline (Path, auto_banking (off))}


Thanks in advance, Shu.


Post a reply to this message

From: Manuel Mata
Subject: Re: camera problems
Date: 24 Aug 2004 07:45:01
Message: <web.412b29a8a547e5a6bd92f76b0@news.povray.org>
"sHURAKAI" <nomail@nomail> wrote:
> But i need to have it focused to a single point. Or even better i would
> like to create another spline for the look_at. Is it possible ?

Right. That happens because u use the spline macros, that make calculations
to move the camera along the path. If you use the spline keyword (that is
normal splines provided by povray) u can do that. For example:

#declare myPath=spline{
point 1,
point 2,
....
}

#declare myLook_at=spline{
point a,
point b,
....
}

camera{location myPath(clock) look_at myLook_at(clock)}

I dont know if that is the right sintax but u can use documentantion for it.
Just use spline keyword instead of spline macros. Create 2 splines one for
path and other one for look_at and use them on the camera. If u want to
focus to a single point use a simple vector for the var myLook_at.

See ya.

                   Manuel Mata Rueda
                   http://es.geocities.com/manuel_mata_rueda


Post a reply to this message

From: sHURAKAI
Subject: Re: camera problems
Date: 25 Aug 2004 11:55:00
Message: <web.412cb52aa547e5a66b3522e90@news.povray.org>
"Manuel Mata" <man### [at] yahooes> wrote:
> "sHURAKAI" <nomail@nomail> wrote:
> Just use spline keyword instead of spline macros. Create 2 splines one for
> path and other one for look_at and use them on the camera. If u want to
> focus to a single point use a simple vector for the var myLook_at.
>
> See ya.
>
>                    Manuel Mata Rueda
>                    http://es.geocities.com/manuel_mata_rueda


Hi Manuel,

and thanks for Your help. You were right, the macro was the problem. Now
it's working fine. :))))))).
I created a little scene with a camera spline for the movement and another

while-loop.
For all the people with the same probs here is a small scene-template (only
the object is missing, works fine with +kff100) :

#include "colors.inc"
global_settings { assumed_gamma 2.2
                  max_trace_level 50}

#declare CamPath = spline {natural_spline
                                       0.00,     <   0, 10,100>,//
                                       0.05,     <   0, 10, 80>,//
                                       0.10,     <   0,  8, 60>,//
                                       0.15,     <   0,  7, 50>,//
                                       0.20,     <   0,  6, 40>,//
                                       0.25,     <   0,  5, 30>,//
                                       0.30,     < -30,  5,  5>,//
                                       0.35,     < -20, 25,  0>,//
                                       0.40,     <   0, 30,  5>,//
                                       0.45,     <  20, 25,  0>,//
                                       0.50,     <  30,  5, -5>,//
                                       0.533,    <  25,  5,-25>,//
                                       0.566,    <   0,  5,-35>,//
                                       0.600,    < -25,  5,-25>,//
                                       0.633,    < -35,  5,  0>,//
                                       0.666,    < -25,  5, 25>,//
                                       0.700,    <   0,  5, 40>,//
                                       0.733,    <  35,  5, 35>,//
                                       0.766,    <  55,  5,  0>,//
                                       0.800,    <  40,  5,-40>,//
                                       0.833,    <   0,  5,-55>,//
                                       0.866,    < -40,  5,-40>,//
                                       0.900,    < -55,  5,  0>,//
                                       0.955,    < -40,  5, 30>,//
                                       1.000,    <   0,  4, 23>}//

#declare LookPath = spline {linear_spline
                                       0.00,     <-1.0,  0,  0>,//
                                       0.10,     <-0.8,  0,  0>,//
                                       0.20,     <-0.6,  0,  0>,//
                                       0.30,     <-0.4,  0,  0>,//
                                       0.40,     <-0.2,  0,  0>,//
                                       0.50,     < 0.0,  0,  0>,//
                                       0.60,     < 0.2,  0,  0>,//
                                       0.70,     < 0.4,  0,  0>,//
                                       0.80,     < 0.6,  0,  0>,//
                                       0.90,     < 0.8,  0,  0>,//
                                       1.00,     < 1.0,  0,  0>}//

#declare CAM_prev_z   = camera {right -4/3*x
                        location < 0.0, 5.0, 100.0 >
                        angle 45.000000
                        look_at < 0, 10, 0 >
                                }

#declare CAM_prev_y   = camera {right -4/3*x
                        location < 0.0, 200.0, 0.0 >
                        angle 75.000000
                        look_at < 0, 10, 0 >
                                }



#declare CAM_motion =   camera {right -4/3*x up y
                        angle 55.000000
                        location (CamPath(clock)+ < 0,3,0 >)
                        look_at (LookPath(clock))
                                }


camera{CAM_motion}


#declare Nr = 0;
 #declare EndNr = 1;
 #while (Nr< EndNr)
 sphere{ <0,0,0>,0.2
   texture{ pigment{color rgb <1-Nr/1.1,0+Nr/1.1,0>}
           finish {ambient 0.25 diffuse 0.85 phong 1}
                }
         translate CamPath(Nr)
       }
 #declare Nr = Nr + 0.002;  //
 #end

#declare Node = 0;
 #declare EndNode = 1;
 #while (Node< 0.5)
 sphere{ <0,0,0> 0.5
         texture{ pigment {color rgb <1,1,1>}
                 finish  {ambient 0.25 diffuse 0.85 phong 1}
                }
         translate CamPath(Node)
       }
#declare Node = Node + 0.05;
#end

#declare Node = 0.5;
 #declare EndNode = 1;
 #while (Node < EndNode)
 sphere{ <0,0,0> 0.5
         texture{ pigment {color rgb <1,1,1>}
                 finish  {ambient 0.25 diffuse 0.85 phong 1}
                }
         translate CamPath(Node)
       }
#declare Node = Node + 0.033;
#end

#declare Nr = 0;
 #declare EndNr = 1;
 #while (Nr< EndNr)
 sphere{ <0,0,0>, 0.2
   texture{ pigment{color rgb <1-Nr/2,0.75+Nr/4,0>}
           finish {ambient 0.25 diffuse 0.85 phong 1}
                }
         translate LookPath(Nr)
       }
 #declare Nr = Nr + 0.001;
 #end

light_source { <0,50,22> rgb<0.5,0.5,0.5> shadowless }
light_source { <-22.2,0,0>      rgb<0.5,0.5,0.5> shadowless }
light_source { <22.2,0,0>       rgb<0.5,0.5,0.5> shadowless }
light_source { <0, 50, 30> color rgb 0.5
               spotlight
               radius 1
               falloff 10
               tightness 1
               point_at <0,0,0>
             }

plane{<0,1,0>, 0
      texture{pigment{ color DarkSlateBlue } }
      translate< 0, -5, 0 >
     }


// Bye and have fun, Shu.


Post a reply to this message

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