Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    camera film back parameters

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 744 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 06/02/2009 at 17:39, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:      
      Language(s) :     C++  ;

      ---------
      We're trying to match a camera move and need to animate a 2D scale on the filmback of the camera. Which C4D parameters would we use for this? I don't see anything under the camera object properties except for zoom, but zoom doesn't appear to be used if the projection type is 'Perspective'.

      In Maya we're able to match this camera with a plugin that animates the camera's "post scale" parameter.

      Does anyone have any experience with this? Any pointers?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 06/02/2009 at 21:46, xxxxxxxx wrote:

        1. This forum is for Cinema 4D PLUGIN DEVELOPER support (note the 'SDK'), not general Cinema 4D USER support. 🙂

        2. Why Zoom is unavailable in Perspective might be because you use Coord:Scale instead? The reason is not specified in the Help. Best to ask at CGTalk forum or similar.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 07/02/2009 at 01:08, xxxxxxxx wrote:

          In Cinema 4D's perspective camera you zoom by changing the focal length.

          cheers,
          Matthias

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 10/02/2009 at 18:46, xxxxxxxx wrote:

            OK, I'm having a hard time getting focal length to work.
            Here's a very simple plugin that creates a camera and attempts to set focal length and fov, letting C4D calculate apeture:

            > \> Bool spCmd::Execute(BaseDocument\* doc) \> { \>     CameraObject\* cam = CameraObject::Alloc(); \>     cam->SetName("test_cam"); \> \>     BaseContainer\* objData = cam->GetDataInstance(); \> \>     objData->SetLong(CAMERA_PROJECTION, Pperspective); \>     objData->SetReal(CAMERA_FOCUS, 25); \>     objData->SetReal(CAMERAOBJECT_FOV, 52.08); \> \>     doc->InsertObject(cam, NULL, NULL, FALSE); \> \>     cam->Message(MSG_UPDATE); \> \>     return TRUE; \> } \> \>

            After executing the plugin, I look at the camera in the attribute manager and see the following:

            Focal Length = 25
                Apeture Width = 36
                Field of View = 71.508

            Why isn't FOV equal to 52.08 (as set), and Apeture equal to something around 24.4?

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 10/02/2009 at 23:34, xxxxxxxx wrote:

              Hey andreaks,

              try to add
              EventAdd();
              after MSG_UPDATE.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 11/02/2009 at 00:40, xxxxxxxx wrote:

                The FOV of Cinema's camera is set by the focal length and the aperture. The aperture of a given FOV and focal length can be calculated like this: aperture = 2.0*focallength*Tangent(FOV/2.0).

                Here the modified code:

                > \> Bool spCmd::Execute(BaseDocument\* doc) \> { \>     CameraObject\* cam = CameraObject::Alloc(); \>     cam->SetName("test_cam"); \> \>     BaseContainer\* objData = cam->GetDataInstance(); \> \>      Real foclen = 25.0; \>      Real fov = Rad(52.08);     //convert to Radians \>      Real apt = 2.0\*foclen\*Tan(fov/2.0); //aperture = 2.0\*focallength\*Tangent(FOV/2.0) \> \>     objData->SetLong(CAMERA_PROJECTION, Pperspective); \>     objData->SetReal(CAMERA_FOCUS, foclen); \>      objData->SetReal(CAMERAOBJECT_APERTURE, apt); \> \>     doc->InsertObject(cam, NULL, NULL, FALSE); \> \>     doc->Message(MSG_UPDATE); \>      EventAdd(); \> \>     return TRUE; \> } \>

                cheers,
                Matthias

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 11/02/2009 at 02:24, xxxxxxxx wrote:

                  whops, i got that completely wrong 😄
                  it really was too early in the morning...

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 12/02/2009 at 15:18, xxxxxxxx wrote:

                    OK I got it working, thanks everyone. If anyone is interested, here's the final code for converting a camera from Maya to C4D. The "m_" data members hold the values from the Maya camera:

                    > \> Real aperture = 2.0 \* m_focal_length[f] \* Tan(m_fov[f]/2.0); \> Real adjust2D = m_post_scale[f] / m_overscan[f]; \> Real tmpval; \> \> key = apertureseq->AddKey(currentTime); \> key->SetValue(apertureseq, aperture); \> \> tmpval = m_focal_length[f] \* adjust2D; \> key = focal_lengthseq->AddKey(currentTime); \> key->SetValue(focal_lengthseq, tmpval); \> \> tmpval = (m_offset_x[f]/m_aperture_x[f]) \* adjust2D; \> key = offset_xseq->AddKey(currentTime); \> key->SetValue(offset_xseq, tmpval); \> \> tmpval = (m_offset_y[f]/m_aperture_y[f]) \* adjust2D \* -1.0; \> key = offset_yseq->AddKey(currentTime); \> key->SetValue(offset_yseq, tmpval); \>

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 13/02/2009 at 08:37, xxxxxxxx wrote:

                      Thanks for sharing.

                      cheers,
                      Matthias

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post