Phongnormals



  • 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?



  • 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


Log in to reply