|
![](/i/fill.gif) |
Stefan Riedel wrote:
>
> How is it possible to call a C? function (one which takes a time and a
> day and gives back
> a direction vector - the sun's position for an animation of shadows over
> a year)
If you only need to call the function once per frame, and know the
calling parameters before you start to render the frame, you can write
the function as a standalone program that takes a command line and saves
a text file containing the desired vector. Then, in your .ini file, add
a line like this:
PreFrameCommand=C:\Stuff\Sun.exe -t 0800 -d 03041999 -p 800315e472238n
--- or whatever parameters your program takes. Then use the file
reading ability of 3.1 to read in the vector in the pov code for the
frame. Or get the macro SunPos (by ingo) at
http://twysted.net/macroscope, tinker it a bit to output your desired
format, and do the calculations with it strictly in your POV code.
Jerry Anning
cle### [at] dhol com
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jerry Anning wrote:
>
> Stefan Riedel wrote:
> >
> > How is it possible to call a C? function (one which takes a time and a
> > day and gives back
> > a direction vector - the sun's position for an animation of shadows over
> > a year)
>
> If you only need to call the function once per frame, and know the
> calling parameters before you start to render the frame, you can write
> the function as a standalone program that takes a command line and saves
> a text file containing the desired vector. Then, in your .ini file, add
> a line like this:
>
> PreFrameCommand=C:\Stuff\Sun.exe -t 0800 -d 03041999 -p 800315e472238n
>
> --- or whatever parameters your program takes. Then use the file
> reading ability of 3.1 to read in the vector in the pov code for the
> frame. Or get the macro SunPos (by ingo) at
> http://twysted.net/macroscope, tinker it a bit to output your desired
> format, and do the calculations with it strictly in your POV code.
I overlooked another method, perhaps the most like what you want. Get
either Dan Connelly's #system patch or the SuperPatch, which contains
it. If you are on a nonWindows system, you'll have to get the former
and compile it in. This gives you the #system command. You use it like
the #debug command, except that it sends the string you give it to the
shell from inside your scene file and executes it via the system
command. So you would say this in your .pov file:
#system "C:\Stuff\Sun.exe -t 0800 -d 03041999 -p 800315e472238n"
Jerry Anning
cle### [at] dhol com
Post a reply to this message
|
![](/i/fill.gif) |