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

    Rotation object

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 539 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 23/01/2007 at 13:19, xxxxxxxx wrote:

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

      ---------
      Hi
      What code have I to write to obtain the entire value of the horizontal rotation of an object?
      Thank you

      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 24/01/2007 at 14:23, xxxxxxxx wrote:

        Can you be please a bit more specific? What kind of rotation do you need, global heading, pitch or bank, or x,y,z?

        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 24/01/2007 at 14:55, xxxxxxxx wrote:

          Ok! Really what I want to obtain is that on having rotated a called "Plane" object, the entire value of the horizontal rotation of this object assigns to itself to a variable to determine the file of a texture, for example: Tex0123.tif
          Thx
          main(doc,vActObj)
          {
           var vObj, vRot;

          var vName="Plane";
            vObj=doc->FindObject(vName);
            if (vObj==NULL) return;
           
           vRot=vObj->GetRotation();
            vActObj->SetRotation(vRot);
           
          var fval = "0000" + tostring(vRot);
          var mval = strmid( fval, sizeof(fval)-4,4);
          var mfn = "F:\\ExemplesXPresso\\Textura\\Arboles\\Tex" + mval + ".tif";
          //
          var mat = doc->GetFirstMaterial();
          mat->SetChannelState(CHANNEL_COLOR, TRUE);
          // Sets a texture for it
          var color = mat->GetChannel(CHANNEL_COLOR);
          var colorC = color->GetContainer();
          colorC->SetData(CH_TEXTURE, mfn);
          color->SetContainer(colorC);
          mat->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 24/01/2007 at 15:34, xxxxxxxx wrote:

            In short, which I am interested in knowing is the rotation: global heading of object
            Thx

            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 25/01/2007 at 04:43, xxxxxxxx wrote:

              this will give you the global rotation of an object.

              var glrot = op->GetMg()->GetHPB();

              glrot.x is the heading
              glrot.y is the pitching
              glrot.z is the banking

              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 25/01/2007 at 11:07, xxxxxxxx wrote:

                Thank you Matthias is exactly this what I want to know.
                Regards,
                Yamp
                http://www.jcuadras-arquitecto.com/PaginasWeb/AnimacionesCinema4D.htm

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