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

    Neighboring Vertices

    SDK Help
    0
    3
    437
    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 14/05/2003 at 22:34, xxxxxxxx wrote:

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

      ---------Hmm... Is there a simple way to get the vertices connected to one? Using the Neighbor class maybe?

      Best Regards,
      bt

      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 14/05/2003 at 23:22, xxxxxxxx wrote:

        Not directly, but by looking at the connected polygons:

            
            
              Neighbor n;  
              n.Init(p->GetPointCount(), p->GetPolygon(), p->GetPolygonCount(), NULL);
            
            
            
            
              LONG pnt = 5;  
              LONG *dadr = NULL, dcnt = 0;  
              n.GetPointPolys(pnt, &dadr, &dcnt);  
                
              std::set<LONG> points;  
              for (LONG i = 0; i < dcnt; i++)  
              {  
                Polygon& poly = p->GetPolygon()[dadr[i]];  
                  
                if (poly.c == poly.d) // Triangle  
                {  
                  if (poly.a != pnt) points.insert(poly.a);  
                  if (poly.b != pnt) points.insert(poly.b);  
                  if (poly.c != pnt) points.insert(poly.c);  
                }  
                else // Quadrangle  
                {  
                  // Check the two possible diagonals  
                  if (poly.a != pnt && poly.c != pnt)   
                  {  
                    points.insert(poly.a);  
                    points.insert(poly.c);  
                  }  
                  else  
                  {  
                    points.insert(poly.b);  
                    points.insert(poly.d);  
                  }  
                }  
              }
            
            
            
            
              for (std::set<LONG>::const_iterator it = points.begin(); it != points.end(); ++it)  
              {  
                GePrint((it == points.begin() ? "" : ", ") + LongToString(*it));  
              }
        
        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 15/05/2003 at 00:21, xxxxxxxx wrote:

          Thank you for your assistance. While that worked for the neighboring vertices my problem remained and became more obvious. I am trying to replicate the way displacement mapping evaluates SelectionTags when deforming vertices for rendering. I cannot seem to find a consistent algorithm ( ok, we all know how darf is at 3:00am ). Can you post the algorithm used for the evaluation of selection state for vertices? I tried the approach of all vertices connected to the current one make it on while any connected that are off make the current vertice off. ( that wasn't it ). It seems that some vertices can be evaluated to an on state when they are on but one is off while on the other side of the poly the same scenario yields an off state ( from my persepctive ). Any ideas?

          Best Regards,
          bt

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