Particle Question.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 06:02, xxxxxxxx wrote:

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

    ---------
    Hey everyone.   I have created my own particle system and am using bd->Point3D() to represent each particle.  This is however, quite taxing on the system and causes the system to slow way down.   Is there a less intensive way that I can display my particles.

    any help would be greatly appreciated.   Thanks,

    ~Shawn



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 06:09, xxxxxxxx wrote:

    Nevermind.  it was a different setting that was slowing things down.

    Although another question I do have is how to I keep the Point3D() instances visible even after the user has clicked off of the object they are being emitted from?  Because using the Draw() when you select a different object, anything that is being drawn by that object stops getting drawn.

    Thanks,

    ~Shawn



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 06:32, xxxxxxxx wrote:

    EDIT: As Matthias pointed out below, I was wrong when writing..

    Ehm, afaik Draw() is not intended for this... I'd say you should rather deliver your particles in GetVirtualObjects()...

    Kabe



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 06:43, xxxxxxxx wrote:

    okay.. I'll give it a try.  Thanks Kabe.

    ~Shawn



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 07:01, xxxxxxxx wrote:

    Particle points like the standard particles or the TP ticks are drawn within Draw(). GetVirtualObjects() is meant for actual object creation.

    You probably have made a mistake within Draw() if your particles vanish as soon as you deselect the object.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/04/2010 at 08:34, xxxxxxxx wrote:

    Here's my Draw().

    Do you see anything that is not correct using the Draw().

    Bool Emitter::Draw(PluginObject *op, LONG type, BaseDraw *bd, BaseDrawHelp *bh)
    {
    	//DECLARATIONS & DEFINITIONS
    	//=============================================================================================
    	BaseContainer * bc = op->GetDataInstance();
    	
    	BaseDocument *doc = op->GetDocument();
    	if (!doc) return FALSE;
    	
    	BaseObject * prnt = doc->GetActiveObject();
    	if (!prnt) return FALSE;
      
    	Real fps = doc->GetFps();						//Get the current Frames Per Second
    	BaseTime bt = doc->GetTime();
    	LONG lngCurrentFrame =	bt.GetFrame(fps);		//Set a variable that represents the current selected frame
    	LONG time = GeGetTimer();						//Get the current Time in milliseconds
      
    	
    	//CREATE EMITTER SURFACE VISUAL AIDE
    	//================================================================================================
    	
    	/*
    	bd->SetPen(bc->GetVector(EMITTER_COLOR));
      
    	bd->Line3D(Vector(prnt->GetPos().x - bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y + bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z),
    				Vector(prnt->GetPos().x + bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y + bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z));
      
    	bd->Line3D(Vector(prnt->GetPos().x - bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y - bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z),
    				Vector(prnt->GetPos().x + bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y - bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z));
    	
    	bd->Line3D(Vector(prnt->GetPos().x - bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y - bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z),
    				Vector(prnt->GetPos().x - bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y + bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z));
    	
    	bd->Line3D(Vector(prnt->GetPos().x + bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y - bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z),
    				Vector(prnt->GetPos().x + bc->GetReal(EMITTER_SIZE_X), 
    				prnt->GetPos().y + bc->GetReal(EMITTER_SIZE_Y), prnt->GetPos().z));
    	//================================================================================================
    */
    	//Begin Emission Loop	
    	if (lngCurrentFrame > 0)
    	{
    		emitter->Update(time, bd, op);
    	}
      
    	return TRUE;
    }
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/04/2010 at 01:05, xxxxxxxx wrote:

    Looking at the code you are using a selected object to do the drawing. Deselecting this object will of course cancel the drawing. If you want to keep the particle still drawn you have to chache them on your own.

    Also if you want access the document you should use the BaseDrawHelp::GetDocument().

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 19/04/2010 at 17:32, xxxxxxxx wrote:

    How would I cache them myself?  Would you mind pointing me toward a resource that could get me started in doing this?

    Thanks,

    ~Shawn


Log in to reply