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:
Cinema 4D Version: 11.5
Platform: Windows ;
Language(s) : C++ ;
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.
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.
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.
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?
PS this is what I have in GetVirtualObjects() to create the polygon.
PolygonObject *polyObj = PolygonObject::Alloc(4,1);
if (!polyObj) goto Error;
padr = polyObj->GetPointW();
vadr = polyObj->GetPolygonW();
padr = Vector(0,-100,-100);
padr = Vector(0,-100,100);
padr = Vector(0,100,100);
padr = Vector(0,100,-100);
vadr = CPolygon(0,1,2,3);