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

    Creating instances of an object.

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 378 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 10/04/2010 at 20:36, xxxxxxxx wrote:

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

      ---------
      Hey everyone.

      I have created a particle generator that uses draw() to create visual representations of the particles.  I would now like to attach instances of an object to each particle.  Would I do this with bd-DrawObject()    and if so,  how would I then update the position of each drawn object.  -or-  would  I need to create the objects in GetVirtualObjects.    if so how would I go about doing this?   Thanks for your time.

      ~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 10/04/2010 at 21:58, xxxxxxxx wrote:

        Well, if you would like to add real stuff in the scene, you must use GetVirtualObjects. You find an example in the SDK - atom.cpp or similarily named.

        Kabe

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

          If you just want a visual representation in the editor (like the standard particles and TP also have), you can do that in Draw(). To create real geometry that can be rendered, you have to use GetVirtualObjects(), as Kabe said.
          How you update those positions is up to you. I guess you have an array with all particle positions stored somewhere in you class, so you can simply use that.
          Cheers,
          Jack

          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 19/04/2010 at 11:20, xxxxxxxx wrote:

            Okay..  so given this information,  If I want to display textured polygons as my particles,  I would create a polygon in GetVirtualObjects,  and then call GetVirtualObjects() is passed a hierarchyhelp..  I will need to define one in my particle update() function..    could someone tell me how to do that?

            Thanks,

            PS this is what I have in GetVirtualObjects() to create the polygon.

              
              
              PolygonObject *polyObj = PolygonObject::Alloc(4,1);  
              if (!polyObj) goto Error;  
              
              Vector *padr=NULL;  
              
              CPolygon *vadr=NULL;  
              
              padr = polyObj->GetPointW();  
              
              vadr = polyObj->GetPolygonW();  
              
              padr[0] = Vector(0,-100,-100);  
              padr[1] = Vector(0,-100,100);  
              padr[2] = Vector(0,100,100);  
              padr[3] = Vector(0,100,-100);  
              
              vadr[0] = CPolygon(0,1,2,3);  
              
              return polyObj;  
              
            Error:  
              
              return NULL;  
              
            

            ~Shawn

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