POV-Ray : Newsgroups : povray.binaries.utilities : About Juha's solution for camera positionning(long I'm afraid) : About Juha's solution for camera positionning(long I'm afraid) Server Time
1 Jul 2024 05:34:44 EDT (-0400)
  About Juha's solution for camera positionning(long I'm afraid)  
From: Jean Montambeault
Date: 25 Aug 1999 10:07:53
Message: <37c3f8b9@news.povray.org>
Juha's said in povray.general :


<  What's wrong with this solution:

    At first sight it seems that I went overboard with my
trigonometry, doesn't it ? :( I was so glad to finally find a use for
the stuff after so many years since highschool.) :} In the process of
making my little macro I've had to re-learn sin(), cos(), radians and
the #macro function : so I was impressed with myself when it worked
(at last). And all this would be to avoid one simple, obvious solution
(or two) ? Dooohhhhhhh!

    Well, not exactly...

    First the "translate ObjectCenter" need to be relative, like this
:

       translate Position_relative_to_object_center + Object_Center

    But I'm sure that's what you meant anyway (I read your posts and
you're not stupid).
    I made a new camera positionning macro inspired by your solutions.
I changed the variable name from "Object_Center" to
"Point_of_Interest" to reflect what I was aiming for more accurately.
If you run side by side my kitchen table .pov example with this one
named after a famous Finnish's aka, you'll see that the first problem
comes when you translate the camera to the Point_of_Interest. I am
nearsighted but not that much ! :) Translating the camera to
Object_Center (or Point_of_Interest as I like to say) last is not
doing it.


    Now the real important stuff.


>>  camera
>>  { location -z*Distance
>>  look_at 0
>>  rotate CameraRotation
>>  translate ObjectCenter
>>  }

    That rotation with Camera_Rotation that you're suggesting... Okay,
let's try it : first you carefully set a Distance : fine until now.
Second you rotate along the azimuth, something like "rotate y*Azimuth"
(note that you won't be able to use one single vector as the rotation
would happen about the X axis first, then the Y axis... and you want
more control than that) : hey ! everything is fine, the distance about
the origin is the same and we're on the side of the object that we
want. Yeah ! But now, how do you go about getting some altitude
(positive or negative) ?
        1- Do you rotate about the X axis or the Z ? Both ? Can be
done but complicated.
        2- If your azimuth is small, say 2 degrees, you won't get very
high or low anyway.
        3- What if your azimuth angle is 200 degrees ? Then your
rotations about X or Z will have the inverse effect : where "rotate
z*PositiveAltitudeAngle" brought you up when Azimuth was between 0 and
180, it will lower your camera when 180 < Azimuth < 360.
        4- Finally, in any case, the distance that you set so
carefully will change in hard to anticipate ways.



>>  or:

>>  camera
>>  { location Position_relative_to_object_center
>>    look_at 0
>>    translate ObjectCenter
>>  }

    Defining Position_relative_to_object_center is not as
straighforward as I'd wish. One might try something like this
<X_position, Y_position, Z_position> + Object_Center but as I said
first, I find it counter-intuitive. I wanted to introduce the concepts
of azimuth, altitude and (absolute, fixed) distance. A vector doesn't
give any precise indication about the distance... well, I'm not that
much a genius at mental calculation anyway.

    Now look, you made me wear out my French-English dictionnary ; I
hope that I didn't make a fool of myself by not seing the obvious
again. POV requires the use of some knowledge long forgotten of me or
never acquired : be gentle.

    I liked the way you named your variables in your examples to make
them self explanatory : I'll adopt it.

        Sincerly yours,

            Jean Montambeault
            Montreal, Canada
            http://pages.infinit.net/copeau


Post a reply to this message


Attachments:
Download 'Juha_sKITCHEN_TABLE.pov.txt' (4 KB) Download 'JuhaCameraMacro.inc.txt' (2 KB)

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