Hi Robert,

A little late but I just noticed this change has broken particle effects
in my application.  When I tried to change my application to work with
this change I get problems with floating point precision on the
particles.  I don't think this change is the correct solution for fixing
floating point precision problems with particle effects.  It's better
done at the application level by separating out non-particle system
nodes, particle processors, and the geodes where particles are placed.
An appropriate MatrixTransform can be placed above each new graph to
resolve the precision issues for the particular frames of reference.
Perhaps Tim Moore can explain further the problem he was trying solve by
giving us an example.

Here are some examples of how this change looks like it might work and
how it doesn't work using the cessnafire.osg model.

1.  How it looks like it might work.  Load the cessnafire.osg model and
put it under a MatrixTransform.  Using the MatrixTransform, move the
model to about 6M meters.  Watch the particle effects when the model is
slowly translated using the MatrixTransform.  The precision of the
particles look good.  The particles are emitted from the correct
location from the model.  The particles once emitted move with the
MatrixTransform when they should stay fixed to the world coordinate
system.

2.  How it doesn't work.  Load the cessnafire.osg model and put it under
a MatrixTransform.  Put the MatrixTransform under a Group.  Move the
Geodes where particles are placed so that they are under the top Group
node.  You may as well move the ParticleSystemUpdater under the top
Group node.  Moving the model out to 6M meters and slowly translate the
model using the MatrixTransform.  The precision of the particles is bad.
The particles are emitted from the correct location but possibly the
wrong direction due to precision problems.  The particles once emitted
stay fixed to the world coordinate system as I would expect.


-----Original Message-----
From: Robert Osfield [mailto:[email protected]] 
Sent: Thursday, September 18, 2008 5:12 AM
To: OpenSceneGraph Submissions
Subject: Re: [osg-submissions] osgParticle ParticleSystem and
ModularEmitterin different coordinate systems

Thanks Tim, I've merged your changes, and also added a
Drawable::getWorldMatrices(const Node*) method and tweaked your code to
use this rather than needing to use getParents(0) and then
getWorldMatrices() as getParents(0) could in theory be null (although in
a correctly set up scene it won't be).

Could you do an svn update and test out my changes, Robert.

On Wed, Sep 10, 2008 at 9:39 AM, Tim Moore <[email protected]> wrote:
> Hello,
> This submission fixes a bug when the ModularEmitter and ParticleSystem

> are in different frames of reference. Specifically, it supports the 
> case where the ParticleSystem is not in the world frame. One way this 
> can come up is if your world coordinate system is Earth-centric; the 
> float coordinates of particles don't have enough precision to avoid 
> terrible jitter and other rendering artifacts, so it's convenient to 
> root the particle systems in a local Z-up coordinate system that gets
moved around from time to time.
>
> I haven't touched the rotation and angular velocity properties of
particles.
> IMHO they are pretty broken, dealing in Euler angles and such, and I 
> see that they aren't used in the rest of the particle system code.
>
> Tim
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscene
> graph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegr
aph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to