Jump to content

particles need help


drarem
 Share

Recommended Posts

I'm using this code in my App Start(), but not seeing particles when running. I can place a sphere in same spot with no problem.

 

 

		    emit = Emitter::Create(1000);

    Material* material = Material::Create();
    material->SetDepthTestMode(false);
    material->SetBlendMode(Blend::Alpha);
    material->SetShader(Shader::Load("Shaders/Particles/default.shader"));
    material->SetTexture(Texture::Load("Materials/Effects/smoke_particle.tex"));

    emit->SetMaterial(material);

    Vec3 gpos = ents->getpos(player);

//place emitter at set position (down below, also placing a sphere at same position to confirm placement)

    emit->SetPosition(gpos.x+5, gpos.y+5, gpos.z+5, true);

    emit->SetEmissionVolume(Vec3(0.5,0.5,0.5));

    emit->SetDuration(26000);

    emit->SetVelocity(0,-.5,0,0);//sets negative y velocity
    emit->SetVelocity(0,1,0,1);//changes the random velocity
    emit->SetRotationSpeed(15); //the particle will now rotate at 15 degrees per second

    emit->AddScaleControlPoint(1,1); //sets inital scale to 1
    emit->AddScaleControlPoint(5,5); //sets final scale to 3

    emit->AddAlphaControlPoint(0,0); //sets inital alpha to 0
    emit->AddAlphaControlPoint(1,1); //sets final alpha to 1

    emit->SetColor(.87,1,.9,.6,0);
    emit->SetColor(.81,.85,.87,1,1);

//place sphere is same spot that smoke would be, but the sphere will fall to the ground when run.
    ents->setpos(bx, Vec3(gpos.x+5, gpos.y+5, gpos.z+5));

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...