Announcement

Collapse
No announcement yet.

Nano particle movement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nano particle movement

    I am making a nano particle simulator, first I needed to make 225 nano particles. As you see in the attached image I made it using this code:
    for (int i = 0 ; i < 15 ; i++)
    {
    for (int j = 0 ; j < 15 ; j++)
    {
    SoSeparator *pSep = new SoSeparator;
    SoTranslation *pTrans = new SoTranslation;
    SoSphere *particle = new SoSphere;
    pSep->addChild(pTrans);
    pSep->addChild(particle);
    particle->radius = 0.015;
    pTrans->translation.setValue(.04*i,.04*j,0);
    m_pSceneRoot->addChild(pSep);

    }
    }
    m_pViewer->viewAll();
    but it is very heavy and even zooming in and out takes longer time. and it seems this not right way.
    Also I need to move each particle separately to different positions with different velocities at each time step. I have no idea what to do, do I need to define one timer sensor for each particle? could you please help me in this issues? [ATTACH=CONFIG]n4022[/ATTACH]
    Last edited by vahidhj93; July 8th, 2016, 08:42 AM.
Working...
X