POV-Ray : Newsgroups : povray.general : Look_at hates me : Re: Look_at hates me Server Time
29 Jul 2024 02:28:23 EDT (-0400)
  Re: Look_at hates me  
From: clipka
Date: 21 Aug 2013 08:33:15
Message: <5214b38b$1@news.povray.org>
Am 21.08.2013 10:48, schrieb Bald Eagle:

> I figured, I'm all set!  I just put the camera in the same positions, and Look
> at the center.  NO PROBLEM.  Except the camera isn't looking anywhere at my
> green sphere at the center.  :(
>
> Help us, precious.
>
>
//####################################################################################
> // Animated Camera
>
//####################################################################################
>
> //Define elliptical orbit
> #declare XE1 = 15*Feet;
> #declare YE1 = 4*Feet;
> #declare ZE1 = 15*Feet;
> #declare CenterE1 = <XE1, YE1, ZE1>;
> #declare XE1scale = 1;
> #declare YE1scale = 1;
> #declare ZE1scale = 2/15;
> #declare RadiusE1 = 15*Feet;
> sphere { 0, 2 pigment { color Green} translate CenterE1}
> //torus {RadiusE1, 2 scale z*ZE1scale pigment { color Green} rotate -y*45
> translate CenterE1 }
>
> #declare A1 = RadiusE1 * XE1scale;
> #declare B1 = RadiusE1 * ZE1scale;
> #declare C1 = A1 * B1;
> #declare C1E1 = XE1-C1;
> #declare C1E2 = XE1+C1;
>
> #declare Clock = 90;
>
> #declare Ellipse1X = cos(radians((Clock/72)*360))*RadiusE1;
> #declare Ellipse1Z = sin(radians((Clock/72)*360))*RadiusE1*ZE1scale;
>
> //sphere {<Ellipse1X, 0, Ellipse1Z>, 2 rotate -y*45 translate CenterE1  pigment
> { color Red} }
>
> #declare Camera_Loc = <Ellipse1X, 0, Ellipse1Z> ;
> camera {right x*image_width/image_height location Camera_Loc rotate -y*45
> translate <XE1, 72, ZE1> look_at CenterE1}
>
//####################################################################################

I have no idea what look_at does when you apply rotations and 
translations first. "Something unexpected" would be my first guess. (I'm 
actually quite surprised it doesn't give you an error message.)

You may want to apply the rotation and translation to Camera_Loc rather 
than the whole camera, like so:

   camera { ...
     location vrotate(Camera_Loc,-y*45)+<XE1,72,ZE1>
     look_at CenterE1
   }


Post a reply to this message

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