Re: [Scripting] camera parameters

Date : Wed, 30 Apr 2008 10:09:26 -0700
To : XSI(at)Softimage.COM
From : Sam Cuttriss <cuttriss(at)whiskytree.com>
Subject : Re: [Scripting] camera parameters
ah, sorry our email was down.
looks like you are on top of things though.

stephen, do you have any idea why we are getting these problems in the first place?
is it something that is likely to be resolved any time soon?



_sam


Byron Nash wrote:
I got it now. I didn't know about the degrees to radians conversion.

Here is the correct equation in Jscript to determine the FOV from the focal length.

XSIMath.RadiansToDegrees(Math.atan( ( Filmback_Width / 2 ) / Focal_Length ) * 2 )


On Wed, Apr 30, 2008 at 10:31 AM, Byron Nash <byronnash(at)gmail.com <mailto:byronnash(at)gmail.com>> wrote:


    Yeah, I just figured that out. Now I'm getting results but
    Math.atan in JScript doesn't seem to give a proper result. I get a
    different value than when I run the numbers on a calculator.

    Shouldn't this return the correct FOV? Those are my hard numbers
    that I used to test the equation.

    LogMessage( Math.atan( ( 8.8 / 2 ) / 14 ) * 2 )


On Wed, Apr 30, 2008 at 10:19 AM, Stephen Blair <Stephen_Blair(at)softimage.com <mailto:Stephen_Blair(at)softimage.com>> wrote:

        shouldn't you be using the same units, instead of mm here and
        in there?

        ------------------------------------------------------------------------
        *From:* owner-xsi(at)Softimage.COM
        [mailto:owner-xsi(at)Softimage.COM
        <mailto:owner-xsi(at)Softimage.COM>] *On Behalf Of *Byron Nash
        *Sent:* Wed 30 April 2008 9:39 AM

        *To:* XSI(at)Softimage.COM
        *Subject:* Re: [Scripting] camera parameters

        I did some searching on the list and found this equation for
        determining the FOV from the filmback and aperature.

        (aTan ((filmback width/2) / focal length)) * 2 = fov (horizontal)

        I'm doing something wrong because my results aren't close to
        what they should be.

        In my case, the Focal Length in XSI is 14mm and the Film
        Aperture is 0.3465 x 0.1949in.

        (aTan( ( 0.3465 / 2 ) / 14 ) ) * 2 = 1.417 ??

        What am I missing other than lots more math in school?

        On Tue, Apr 29, 2008 at 9:18 PM, Byron Nash
        <byronnash(at)gmail.com <mailto:byronnash(at)gmail.com>> wrote:

            No Sam, that's not what I'm up to but your problem is what
            I'm looking for. That's not very encouraging that you have
            to find a work around. I'm doing some work on the
            XSI-to-AE script during downtime. The script doesn't work
            when the projection plane is animated. I'm trying to build
            in all the error functionality that wasn't there to start
            with. Do you still have any of that code you wrote laying
            around? I have no idea how the math works to generate
            those numbers so I'm pretty much fumbling around in the dark.


On Tue, Apr 29, 2008 at 5:34 PM, Sam Cuttriss <cuttriss(at)whiskytree.com <mailto:cuttriss(at)whiskytree.com>> wrote:

                let me guess, you are trying to render an animated
                camera X% oversized?

                i ran into the same thing recently and almost lost my
                mind at 3 in the morning.
                i think my email to the list was censored (probably
                for the best)

                it seens the proj plane is only calculated when the
                camera properties is open?
                after trying a list of simple options as long as my
                arm i ended up writing a scop that did all the trig
                and set the values.
                which was frustrating considering the value i wanted
                was laughing at me onscreen but unattainable.

                _sam


Byron Nash wrote:

                    Thanks Matt, that did the trick. Any idea why when
                    I have an expression on the Projection Plane
                    distance(linking it to another camera), that the
                    FOV value doesn't change when I access it's value
                    in scripting?

                    On Tue, Apr 29, 2008 at 4:30 PM, Matt Lind
                    <mlind(at)carbinestudios.com
                    <mailto:mlind(at)carbinestudios.com>
                    <mailto:mlind(at)carbinestudios.com
                    <mailto:mlind(at)carbinestudios.com>>> wrote:

try this instead:
LogMessage( oCamera.Name );
LogMessage( oCamera.Parameters( "projplane"
).value );
Matt
------------------------------------------------------------------------
*From:* owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM
<mailto:owner-xsi(at)Softimage.COM>
<mailto:owner-xsi(at)Softimage.COM
<mailto:owner-xsi(at)Softimage.COM>>] *On Behalf Of
*Byron Nash
*Sent:* Tuesday, April 29, 2008 1:18 PM
*To:* xsi(at)Softimage.COM
*Subject:* [Scripting] camera parameters


                           I'm having trouble with the second line
                    I've pasted below. The
                           first line properly returns the name of the
                    camera in the
                           newCam variable. I can't figure out why it
                    doesn't work in the
                           second line even though I've tested it in
                    another script.

logmessage(newCam.name); logmessage(newCam.camera.projplane.value);

                           What I'm trying to do is check whether the
                    Projection Plane is
                           turned on for this camera.

                           Thanks.


-- Byron Nash




-- Byron Nash



--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi




-- Byron Nash





-- Byron Nash





-- Byron Nash





--
Byron Nash

--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.