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

    Phongnormals

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 190 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 11/05/2007 at 06:29, xxxxxxxx wrote:

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

      ---------

        
           if(tag)  
           {       
                   Vector* curr_phong_normals = op->CreatePhongNormals();  
                GePrint("Reading Phong Tag");  
                for(LONG i = 0; i < nOfPolys; ++i)  
                {                 
                     phongnormals _= curr_phong_normals _;  
                }  
        
                GeFree(curr_phong_normals);       
      ....  
      }  
      

      I use CreatePhongNormals() to access cinemas phongnormals and export them with my plugin.
      For most of the standardforms this works fine.
      But it always crashes when I try to export the figure.
      (I make the figure editable and connect all parts into 1 mesh before exporting)

      The funny thing is, it doesnt crash if I lower the segments count first.

      Is there any other way to access the phongnormals?

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

        it works just fine here, even with the figure. i just following code.

        static void WriteObjects(BaseObject *op)
        {
             while (op)
             {
                  if ((op->GetType()==Opolygon) && (op->GetTag(Tphong,0)))
                  {
                       LONG    i,vcnt = ToPoly(op)->GetPolygonCount();
                       Vector *normals = ToPoly(op)->CreatePhongNormals();

        for (i=0; i<vcnt; i++)
                       {
                            GePrint("A "+RealToString(normals[i+0].x)+", "+RealToString(normals[i+0].y)+", "+RealToString(normals[i+0].z));
                            GePrint("B "+RealToString(normals[i+1].x)+", "+RealToString(normals[i+1].y)+", "+RealToString(normals[i+1].z));
                            GePrint("C "+RealToString(normals[i+2].x)+", "+RealToString(normals[i+2].y)+", "+RealToString(normals[i+2].z));
                            GePrint("D "+RealToString(normals[i+3].x)+", "+RealToString(normals[i+3].y)+", "+RealToString(normals[i+3].z));
                       }

        GeFree(normals);
                  }

        WriteObjects(op->GetDown());
                  op=op->GetNext();
             }
        }

        cheers,
        Matthias

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