Hi Robert, I found time to look at this problem. What you had usually won't work because the rotation applied in Particle::render doesn't always match what is going on in ParticleSystem::single_pass_render. It may work for applications where Y is up, X is to the right, and Z is toward the viewer like VTP. I'm not sure how to fix it other than reversing most of the r7961 changes.
I've enclosed a modified ParticleSystem.cpp with some of the r7961 changes you made in single_pass_render. It looks like there is a typo in calculating yAxis. I think it should be scaleY*scaleY instead of scaleX*scaleY. Since I'm not sure what you were trying to do with this I left that part the way you had it. > -----Original Message----- > From: Robert Osfield [mailto:[email protected]] > Sent: Wednesday, November 12, 2008 3:42 AM > To: OpenSceneGraph Users > Subject: Re: [osg-users] Particle system > setInitialRotationalSpeedRange() > > Hi Thom, > > Thanks for the detective work. The change you've suggested as > causing the regression is r7961. > > http://www.openscenegraph.org/projects/osg/changeset/7961 > > It's six months since I code this so it's a bit cold a topic > so off the top of my head I can't point to anything in a > particular as being the cause of the problems. I will have > to sit down and step through the code. > > Thanks for pointing out that SmokeBox.osg reproduces the > problem, with the problem in front of me it's very difficult > to spot issues in code. > > Robert. > > > On Tue, Nov 11, 2008 at 11:21 PM, Jolley, Thomas P > <[email protected]> wrote: > > Hi Robert, > > > > I've looked into this a little further. It appears the changes you > > made to ParticleSystem.cpp on March 17th is the reason for the > > behavior change. I don't have a solution yet other than > backing out > > the changes. I'm still trying to understand what you're > doing in the > > single_pass_render function before coming up with a solution. > > > > I think this problem was mentioned in an earlier thread around May. > > See > http://lists.openscenegraph.org/pipermail/osg-users-opensceneg > raph.org/2008-May/011595.html. > > > > To see the problem look at SmokeBox.osg with osgviewer (I'm > using osg > > 2.6.0). The particles are rotating about the wrong axis > (or at least > > a different axis). > > > > ---- > > Tom Jolley > > > > > > ________________________________ > > From: Jolley, Thomas P > > Sent: Thursday, August 21, 2008 2:11 PM > > To: OpenSceneGraph Users > > Subject: Re: [osg-users] Particle system > > setInitialRotationalSpeedRange() > > > > Hi Erik, > > > > I noticed the same thing about a week ago while upgrading an > > application from osg 1.0 to 2.4. It was on my list of > things to look into. > > > > ________________________________ > > From: Erik Johnson [mailto:[email protected]] > > Sent: Thursday, August 21, 2008 10:30 AM > > To: [email protected] > > Subject: Re: [osg-users] Particle system > > setInitialRotationalSpeedRange() > > > > There is certainly a change in behavior, although I can't > pinpoint the > > change in code yet. > > > > Setting the rotational speed with (0, 0, 1): > > OSG 2.2.0 - particles rotate like fans (pinwheels) OSG 2.4.0 - > > particles rotate like a margarita blender (cork-screw) OSG 2.6.0 - > > particles rotate like a margarita blender (cork-screw) > > > > I guess I'm just wondering if this is the expected > behavior? And I'm > > surprised nobody has a problem with this. > > > > Thanks, > > Erik > > > > > >> Date: Thu, 21 Aug 2008 09:26:52 +0100 > >> From: "Robert Osfield" <[email protected]> > >> Subject: Re: [osg-users] Particle system > >> setInitialRotationalSpeedRange() > >> To: "OpenSceneGraph Users" <[email protected]> > >> Message-ID: > >> > <[email protected]> > >> Content-Type: text/plain; charset=ISO-8859-1 > >> > >> Hi Erik, > >> > >> osgParticle has hardly been touched between OSG-2.2 and > 2.6. Use svn > >> log to check which files have changed. > >> > >> Robert. > >> > >> On Thu, Aug 21, 2008 at 1:07 AM, Erik Johnson > >> <[email protected]> > >> wrote: > >> > Hi all, > >> > > >> > It seems to me, back in the OSG 2.2.x time frame, that I > could set > >> > the initial rotational velocity of the RadialShooter and > have the > >> > particles "pinwheel" around their center point, while > maintaining > >> > their billboard orientation and face the Camera. > Perhaps it was a rotation on the "Y" > >> > axis. > >> > > >> > Nowadays with OSG 2.4/2.6, setting the rotational speed > will cause > >> > the particles to rotate relative to the world axis and > not in the > >> > camera-relative axis. > >> > > >> > Is this a bug? A feature? Is it still posible to "pinwheel" a > >> > particle around? Does anyone use > setInitialRotationalSpeedRange()? > >> > > >> > This was a cool effect which added a nice dimension to > smoke plumes > >> > and such. > >> > > >> > Thanks for any info! > >> > -Erik Johnson > >> > > >> > > >> > _______________________________________________ > >> > osg-users mailing list > >> > [email protected] > >> > > >> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegra > >> > ph.org > >> > > >> > > >> > > > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > > org > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce > negraph.org >
ParticleSystem.cpp.gz
Description: ParticleSystem.cpp.gz
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

