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

    Polygon Plane

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 732 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 06/03/2010 at 20:13, xxxxxxxx wrote:

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

      ---------
      Hey everyone,

      Could anyone tell me the process involved in creating a polygon plane object from scratch?  Or point toward something that can guide me through this process.

      Thanks,

      ~Shawn

      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 08/03/2010 at 09:41, xxxxxxxx wrote:

        Anyone have any info about this.  I want to know how to create a plane from scratch.  Not creating a plane primitive, but creating a polygon object and adjusting its points and polygons to create a plane.  Is there something that could point me in the right direction.  I checked out the rounded tube sample in the SDK but I do not see where the geometry is created.

        Thanks,

        ~Shawn

        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 08/03/2010 at 12:22, xxxxxxxx wrote:

          Hi, this little example will create a quad with the given coordinates:

            
          BaseObject *drawPlane::GetVirtualObjects(PluginObject *op, HierarchyHelp *hh)   
          {   
               PolygonObject *obj = NULL;   
               Vector *padr=NULL;   
               CPolygon *vadr=NULL;   
               obj = PolygonObject::Alloc(4,1);   
               if (!obj) goto Error;   
               padr=obj->GetPointW();   
               vadr=obj->GetPolygonW();   
               padr[0] = Vector(-100,0,-100);   
               padr[1] = Vector(-100,0,100);   
               padr[2] = Vector(100,0,100);   
               padr[3] = Vector(100,0,-100);   
               vadr[0] = CPolygon(0,1,2,3);   
               return obj;   
          Error:   
               return NULL;   
          }   
          

          hope it helps..
          cheers,
          ello

          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 08/03/2010 at 12:33, xxxxxxxx wrote:

            Great, thanks ello.    I want to be able to control the number of polys on the plane so I would do this by creating more polys like this?

            Thanks again.

            ~Shawn

            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 08/03/2010 at 13:29, xxxxxxxx wrote:

              yes, you just need to allocate the PolygonObject corresponding to that number, or you adjust it later on with ResizeObject(LONG pcnt, LONG vcnt)

              cheers,
              ello

              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 08/03/2010 at 15:18, xxxxxxxx wrote:

                Hi ello,   I copied and pasted your code in to my object plugin just to see how it works and I get nothing.  No polygon is created.  Any thoughts as yo why this is?

                Thanks,

                ~Shawn

                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 08/03/2010 at 23:15, xxxxxxxx wrote:

                  hm. it worked at home. i'll give it another try here at work when i have a break...

                  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 08/03/2010 at 23:33, xxxxxxxx wrote:

                    ok, it works here, too.

                    here is my whole code:

                      
                    #define pluginID 1000001   
                    #include "c4d.h"   
                    #include "c4d_symbols.h"   
                    #include "customgui_description.h"   
                      
                    #define pluginName "testObj"   
                      
                    class testObj : public ObjectData   
                    {        
                         INSTANCEOF(testObj,ObjectData);   
                    public:   
                         virtual Bool Init(GeListNode *node);   
                         virtual BaseObject* GetVirtualObjects(PluginObject *op, HierarchyHelp *hh);   
                         virtual Bool Message(GeListNode *node, LONG type, void *t_data);   
                         static NodeData *Alloc(void) { return gNew testObj; }   
                    };   
                      
                      
                      
                    Bool testObj::Init(GeListNode *node)   
                    {   
                         BaseObject          *op          = (BaseObject* )node;   
                         BaseContainer *data = op->GetDataInstance();   
                      
                         return TRUE;   
                    }   
                      
                    Bool testObj::Message(GeListNode *node, LONG type, void *t_data)   
                    {   
                         if (type==MSG_DESCRIPTION_VALIDATE)   
                         {   
                              BaseContainer *data = ((BaseObject* )node)->GetDataInstance();   
                         }   
                         return TRUE;   
                    }   
                      
                    BaseObject *testObj::GetVirtualObjects(PluginObject *op, HierarchyHelp *hh)   
                    {   
                         PolygonObject *obj = NULL;   
                         Vector *padr=NULL;   
                         CPolygon *vadr=NULL;   
                         obj = PolygonObject::Alloc(4,1);   
                         if (!obj) goto Error;   
                         padr=obj->GetPointW();   
                         vadr=obj->GetPolygonW();   
                         padr[0] = Vector(-100,0,-100);   
                         padr[1] = Vector(-100,0,100);   
                         padr[2] = Vector(100,0,100);   
                         padr[3] = Vector(100,0,-100);   
                         vadr[0] = CPolygon(0,1,2,3);   
                         return obj;   
                    Error:   
                         return NULL;   
                    }   
                      
                      
                      
                    Bool Register_testObj(void)   
                    {   
                         return RegisterObjectPlugin(pluginID,pluginName,OBJECT_GENERATOR|OBJECT_INPUT,testObj::Alloc,"OtestObj","testObj.tif",0);   
                    }   
                    

                    hope it works for you..

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