|
![](/i/fill.gif) |
There's actually a LOT of math involved in that, especially if you want to
handle all sorts of sky vectors (rolling the camera). Luckily for you, the
math has been done already. I did it for my lens flare include file, and
adapted it for a "background" INC file (yet to be released).
The background.inc file creates a plane with a user-defined texture which is
lined up with the camera's view at a user-defined distance from the camera.
The math would basically be the same for putting everything in foreground, but
the user would specify a much shorter distance and probably want to clip the
plane (or use a different object, like a text object).
I'll post here again when I finish cleaning up the INC files.
-Nathan
Lewis Sellers wrote:
>
> Well, I was trying to do this myself, but my math is so weak it'll take
> me forever.... :)
>
> Ok. I was trying to make it so that the small text "Copyright 1998 by
> Lewis Sellers" would automatically be placed in the bottom left of any
> scene I rendered no matter the camera positions. Very handy in
> animations, etc.
>
> In the snip of code below, you'll see I declare cam_l for the camera
> location value and cam_lat for the camera look_at value. Using those two
> positions I try to compute the translate and rotate needed to position
> the text properly.
>
> I managed to get the text roughly where it needs to be, but can't figure
> out how to rotate it.
>
> If anyone who's mathematically endowed can help, I'd appreciate it. This
> could be a neat little piece of code to plug in for everyone to
> autoinsert copyrights on our pics during rendering. :-)
> --min
>
> //
> #declare cam_l = <125,8,-2>;
> #declare cam_lat = <0,0,0>;
>
> camera {
> location cam_l
> look_at cam_lat
> angle 90
> }
>
> #declare camc=vnormalize(cam_lat-cam_l);
>
> //put up the copyright now matter where the darn camera is!
> #debug concat(".x :", str(cam_l.x,5,2), "\n")
> #debug concat(".y :", str(cam_l.y,5,2), "\n")
> #debug concat(".z :", str(cam_l.z,5,2), "\n")
> #debug "\n"
>
> #debug concat("camc.x :", str(camc.x,5,2), "\n")
> #debug concat("camc.y :", str(camc.y,5,2), "\n")
> #debug concat("camc.z :", str(camc.z,5,2), "\n")
> #debug "\n"
> text {
> ttf "timrom.ttf" "Copyright 1998 by Lewis Sellers" .01, 0
> pigment { rgbt<1,0,0,1> }
> translate cam_l
> translate camc
> rotate<camc.x*360,0,0> //camc.y*360,camc.z*360>
> no_shadow
> }
>
> --
> Lewis A. Sellers: writer and contract Multimedia Website Developer
> mailto:lse### [at] usit net (The Fourth Millennium Foundation)
> http://www.public.usit.net/lsellers/ & http://www.intrafoundation.com
> http://brain-of-pooh.tech-soft.com/users/critters/bios/sellers_lewis.html
>
> You can bug the living bejesus out of me live on ICQ @ 491461
> (If I don't get back to you within a month, I'm out of prozac in some
> dark corner somewhere screaming things quite unintelligable but -- most
> curiously -- thick with a sumerian accent.)
>
> "The comedy is over" -i pagliacci
Post a reply to this message
|
![](/i/fill.gif) |