Hi John,
I just did a quick search of the osgParticle headers, and came across
the following:
enum ParticleScaleReferenceFrame
{
LOCAL_COORDINATES,
WORLD_COORDINATES
};
/** Set whether the particles should be scaled relative to
world coordaintes or local coordinates.*/
void setParticleScaleReferenceFrame(ParticleScaleReferenceFrame
rf) { _particleScaleReferenceFrame = rf; }
/** Get whether the particles should be scaled relative to
world coordaintes or local coordinates.*/
ParticleScaleReferenceFrame getParticleScaleReferenceFrame()
const { return _particleScaleReferenceFrame; }
Have you tried use these osgParticle::ParticleSystem scale methods?
Robert.
On Thu, Jun 11, 2009 at 8:59 AM, John Vidar
Larring<[email protected]> wrote:
> Hi Robert,
>
> Thanks for a quick reply.
>
>> What it sound likes you are after is that you
>> want the effect to be computed in local coordinates, and it won't be
>> just the emitter than you are likely to be wanting to scale, but
>> everything about the particle system.
>
> IMHO, the particle system seems to scale correctly with the parent
> transforms, it is _only_ the "created" particles themselves that does not
> scale since they need to operate in world coordinates.
>
> If you modify the example program at line 122 to set the scale of
> cessnafire.osg as follows (modified test program is attached):
>
> double cessna_scale = 600.0 / cessna->getBound().radius();
>
> Then you should see that the particle system (extent of particles, etc)
> scales with the cessna, but not the individual particles (see attached
> images). The purpose of the submission is to give the particles their
> correct initial scaling based on the scaling of the particle system.
>
> There might be other properties of the created particles that needs to be
> scaled as well... But I've just started using osgParticles so I can't speak
> with much authority here:)
>
> Best regards,
> John
>
> Robert Osfield wrote:
>>
>> Hi John,
>>
>> I think this issue is not a bug but one of lack of user control on
>> whether you want to scale your particles by the local reference or in
>> world coordinates. osgParticle principally works in world
>> coordinates, and when you are emitting particles you are emitting in
>> the world coordinate frame, it's does this as it's approximating to
>> real world effects. What it sound likes you are after is that you
>> want the effect to be computed in local coordinates, and it won't be
>> just the emitter than you are likely to be wanting to scale, but
>> everything about the particle system.
>>
>> Robert.
>>
>> On Wed, Jun 10, 2009 at 4:57 PM, John Vidar
>> Larring<[email protected]> wrote:
>>>
>>> Hi Robert,
>>>
>>> I've just started experimenting with the osgParticle nodekit and I think
>>> I
>>> have found an issue: The ModularEmitter creates particles in a constant
>>> size/scale without considering the accumulated scale of its parent
>>> object.
>>>
>>> A simple example to illustrate the issue: If I want to illustrate an
>>> airplane with engine trouble over Orlando on a world map, I need to
>>> exaggerate the size of the airplane model (cessnafire.osg) by placing it
>>> under an appropriate transform. However, since the Particle system places
>>> the particles above the transform, they seemingly disappear.
>>>
>>> The modification in ModularEmitter::emit() is to find the accumulated
>>> scale
>>> that needs to be applied to the particles, and apply that scale to the
>>> particles size range as particles are created.
>>>
>>> Please run the attached test program (with or without a terrain as an
>>> argument). Before the patch is applied, you will only see the cessna.
>>> After
>>> the patch is applied, an engine fire will appear.
>>>
>>> Modifications have been made to svn trunk version: 10319
>>>
>>> Since this submission avoids API changes, I hope that it can make it to
>>> osg
>>> 2.8.2 as well.
>>>
>>> Please feel free to change the implementation since this is basically a
>>> hack
>>> to get things working for my own needs;) Thanks in advance.
>>>
>>> Best regards,
>>> John
>>>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org