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

    SVector to Vector?

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 176 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 15/09/2010 at 18:28, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R12 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Howdy,

      OK, maybe it's just my inexperience with c++, but I'm not getting how to convert SVector to Vector.

      Here is my old code:

      Vector aN, bN, cN, dN;   
      Vector *phN = ToPoly(op)->CreatePhongNormals();   
      aN = !phN[pInd*4];   
      bN = !phN[pInd*4+1];   
      cN = !phN[pInd*4+2];   
      dN = !phN[pInd*4+3];   
      if(phN) GeFree(phN);
      

      In R12 CreatePhongNormals() returns an SVector, but I can't seem to figure out how to convert it.

      I tried this:

      Vector aN, bN, cN, dN;   
      SVector *phN = ToPoly(op)->CreatePhongNormals();   
      aN = !phN[pInd*4].ToLV();   
      bN = !phN[pInd*4+1].ToLV();   
      cN = !phN[pInd*4+2].ToLV();   
      dN = !phN[pInd*4+3].ToLV();   
      if(phN) GeFree(phN);
      

      But that gives me errors.
      How should I rewrite the old code to work with R12?

      Adios,
      Cactus Dan

      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 15/09/2010 at 19:35, xxxxxxxx wrote:

        Howdy,

        OK, now I feel silly.

        It works if I use the correct function: SVector::ToRV() instead of SVector::ToLV().

        Adios,
        Cactus Dan

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