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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Camera - TargetExpressionTag - Cinema 7/8

    SDK Help
    0
    6
    977
    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
      Helper
      last edited by

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

      On 22/07/2003 at 06:11, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      i want to export the camera target...
      with cinema 7 it works fine, with 8 i get a NIL object ?!
      here the snippet:
       
         // CAM TARGET
         var objTag = pObject->GetFirstTag();
         while(objTag != NULL)
         {
          var objClass = getclass(objTag);
          if (objClass == TargetExpressionTag)
          {
           // TARGET NAME
           var targetContainer = objTag->GetContainer();
           var strTargetName = targetContainer->GetData(TARGETEXPRESSIONTAG_NAME);
           println("camtargetame: ", strTargetName);
           WriteChunk(CHUNK_CAMERA_TARGET_NAME);
           WriteZeroString(strTargetName);
            var tmpObject = g_pDoc->GetFirstObject();
            while(tmpObject != NULL)
            {
             var strTmpName = tmpObject->GetName();
             if ( 0 == strcmp(strTargetName, strTmpName) )
             {
              // TARGET POSITION
              var vecTargetPos = tmpObject->GetPosition();
              println("camtargetpos: ", vecTargetPos);
              WriteChunk(CHUNK_CAMERA_TARGET_POSITION);
              g_pFile->WriteReal(vecTargetPos.x);
              g_pFile->WriteReal(vecTargetPos.y);
              g_pFile->WriteReal(vecTargetPos.z);
             }
             tmpObject = tmpObject->GetNext();
            }
          }
          objTag = objTag->GetNext();
         }

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

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

        On 23/07/2003 at 06:56, xxxxxxxx wrote:

        Hi,
        in R8 the target object is not a string anymore but a BaseLink. And baselinks are unfortunately not accessible anymore in R8 via COFFEE.
        Either you switch to C++ or you will need to wait for an updated COFFEE SDK (or somebody writes a plugin that allows to pass the baselink to COFFEE - I even remember somebody actually is working on such a plugin).
        There is no workaround for this afaik.
        Best
        Samir

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

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

          On 24/07/2003 at 14:35, xxxxxxxx wrote:

          how lame...
          and how to get the "up" vector from the camera ?
          rotations ?

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

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

            On 24/07/2003 at 15:40, xxxxxxxx wrote:

            what do you mean by "up" vector? The rotations of the camera can be accessed just as any other object rotations with GetRotation or u use the local/global matrix of the object for the rotation values.
            See the COFFEE docs for more information. (And maybe a good book about OOP 😉
            Best
            Samir

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

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

              On 24/07/2003 at 18:03, xxxxxxxx wrote:

              i am coding an exporter for my d3d9 engine...
              and there, the camera has an "eye" (cam-pos), "lookat" (cam-targetpos) and
              "up" (?) vector... opengl also has those 3 vectors...
              so my question is how to get that "up" vector out of cinema.
              www.igoronimo.org/work.html
              some screenshots...

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

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

                On 25/07/2003 at 11:26, xxxxxxxx wrote:

                Get the matrix of the camera object. It sounds like:

                    
                    
                    var mat = cam->GetMg();  
                    eye = mat->GetV0();  
                    lookat = mat->GetV3(); // Z axis  
                    up = mat->GetV2(); // Y axis
                

                I assume that D3D doesn't store the X axis vector since it's always Y x Z.

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