Neighboring Vertices



  • 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



  • 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));  
          }
    


  • 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


Log in to reply