POV-Ray : Newsgroups : povray.tools.general : Returning camera position. : Re: Returning camera position. Server Time
19 Apr 2024 08:17:39 EDT (-0400)
  Re: Returning camera position.  
From: StephenS
Date: 25 Nov 2012 16:35:00
Message: <web.50b28e99e3ed572d17cf88690@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 25/11/2012 7:05 PM, StephenS wrote:
>
> > With focal_blur no; without, maybe.
> > declare the camera output in a text string.
> >
> > #declare A="
> > .....
> > ";
> > // keep under 256 characters?
> >
>
> That is the problem. I wanted to use B3D's animation system. So the
> camera location changes in a non linear way as does the "look At" and
> FOV.
....
Camera
Box
force declare, force export; with raw script
inspect generated script


//------- C Raw Script Begin -------
#declare AA="
//------- C Raw Script End ---------

#declare C =
camera {
 perspective
 location <-4.000,6.000,-12.000>
 up y
 right 1.333*x
 angle 33.000
 sky <0.136,0.904,0.407>
 look_at < 0.000, -0.000, 0.000 >
}


//------- B Raw Script Begin -------
";
//------- B Raw Script End ---------

#declare B =
box {
 < -0.5000000, -0.5000000, -0.5000000 >, < 0.5000000, 0.5000000, 0.5000000 >
}

Bishop3d will update the camera statement for each file in the animation.

#local Mycount = 0;
//Find the first use of 'scale'
#while (strcmp(substr(Mystring,Mycount,5) , "scale")!=0 & Mycount !=
strlen(Mystring)-5)
  #local Mycount = Mycount+1;
#end

** example of parseing, this is for scale**

Recreate the camera statement

#declare C = camera{
perspective
location Mystring
....
}
// C is the name of the camera in
// this example that Bishop3d exports at the end of the scene file

#if (Mycount != strlen(Mystring)-5) // if scale is found in the string, then
scale the function
  #local Scale_x = val (substr(Mystring,Mycount+11,Mycomma-Mycount+11));

You now also have a variable to give to other macros.

This is not working code, and is taken from different scene files. It is only to
show, that if you can wrap the exported camera statement in quotation marks, you
can re-parse the code back into Bishop3d.

A better example can be made with time ;-)

Stephen S


Post a reply to this message

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