[osg-users] OsgParticle when is the particleSystemUpdater called

ivar out ivarout2 at gmail.com
Wed Aug 15 06:51:10 PDT 2018


I have two questions regarding the use of theosgParticle class.
(1) I'm trying to create a plume emitter, though I would like be able to adjust the color and alphaRange of the particle template depending on the viewer that renders it. My first attempt was to update the color range before rendering a frame of the second viewer, using:


while (!viewer.done())
	ps->getDefaultParticleTemplate().setColorRange(osgParticle::rangev4(osg::Vec4(1, 0, 0, 1), osg::Vec4(0, 0, 1, 1)));

	ps->getDefaultParticleTemplate().setColorRange(osgParticle::rangev4(osg::Vec4(1, 1, 0, 1), osg::Vec4(0, 0, 1, 1)));

where ps is the particle system. Though this will only use the first defined color range for both frames. I guess I am failing to understand when exactly the particleSystemUpdater is called. 

(2) I was also wondering why the shape of the emitted plume changes drastically when I increase the timestep per frame. For example, when I create frames at discrete timesteps using the following bit of code, only a small part of the plume will be visible, as if many particles were never created, or killed too soon.:


double simulationTime = 0;
simulationTime += 0.1;

I'm sorry I'm not too experienced in OSG  :-* . any help would be very much appreciated! :)

ivar [/code]

Read this topic online here:

More information about the osg-users mailing list