Node Rotation and Translation Question

This is kind of hard to explain but I’ll try my best.



I have a shipNode which I’m attaching thruster nodes to. These thruster nodes have a particle effect attached to the node.



ShipNode -> ThrusterNode -> ParticleEffect (Jets)



The Keyboard controls update the ShipNodes local rotation and translation which is propogated to the thrusterNode and thus to the particleEffect (Thanks to renase’s update). Thus as you turn the ship and move it around the jet always is coming out the back of the ship.



The problem is that I wanted to move the jet down slightly. Right now the starting point of the particles is in the middle of the ship. I wanted it so that the particles start right at the back of the ship.



Unfortunately if I just translate the thrusterNode to the back of the ship then when you rotate the ship the point of origin for the jet moves.





I took two small screenshots that will hopefully illustrate the problem.



The below shot is where I want the jet to always start from (right behind the ship)





In the shot below you can see when I rotate the ship, the jet is no longer coming straight out the back of the ship.







Before using Nodes I was just had the jet as a controller and I would update it’s position each frame. That was working out fine.



Anyone know what the problem might be? Thank you!

hmm, so the rotation is correct, but not the starting point? I’ll try to reproduce with one of our tests.

One thing to check, are you sure the particle is the same height as the ship. Since we are viewing this is a 3D space, when the particle and ship are lined up (up/down) then they will appear correct, but as the ship rotates, you’ll start to see the particles are slightly above the ship. It’s a long shot, but something worth looking into.

They ship and jet effect are in the same plane.

I just updated to the newest jme build and the jet (particles) no longer rotate with the node they are attached to. Did this get changed in the last few hours? Thanks.

No, what files did you pull down from cvs? So you are saying it’s not working right now?

I redownloaded the entire jme library. I just include the jme project in my path so I’m not using a jar or anything.



The particles translate with the node but they don’t rotate anymore.



I have ParticleManager.java version 1.19

Hmm, well I’m not sure… The latest version is 1.19 (which you have) and that was checked in yesterday. You started this thread after that version was checked in.

http://www.jmonkeyengine.com/jmeforum/viewtopic.php?t=1466&postdays=0&postorder=asc&start=0



was changed today…

I solved the not rotating at all problem. I was including the jme Physics stuff in my compile path and that had an old jme.jar which was getting included automatically and overriding the new stuff.



As far as the original problem with the starting point not being correct.



Do you think that’s something on my end or within jME?

"mojomonk" wrote:
http://www.jmonkeyengine.com/jmeforum/viewtopic.php?t=1466&postdays=0&postorder=asc&start=0

was changed today...
Actually that's the change from yesterday I was talking about.
"shochu" wrote:
Do you think that's something on my end or within jME?

Have another look at TestDynamicSmoker and TestRigidSmoker... I position the particles so that they come out the end of the tube and that works fine. Maybe it will give you some ideas.

Well the first thing is that in the DynamicSmoker demo you are attaching the particles to the Disc geometry and then attaching that to the Node using the setGeometry method.



In my program I’m attaching the particles directly to the node by doing


Node.attachChild(manager.getParticles());



Should my way work as well? If not it's not a big deal and I'll switch to using setGeometry, just want to make sure I'm getting expected behavior.

Here's a screenshot of the problem. I've attached a red sphere to the thrusterNode as well as the particles. This makes it easy to to see the problem. The sphere is always in the right place. The particles don't seem to rotate correctly.

(Working okay in this orientation only)


(Not rotating correctly)


It looks like the particles aren't centered properly becuase they are starting further out from the red sphere. So it's almost like the rotation axis is going to be different. Not quite sure. Anyway, I'll switch over to the setGeometry method if I can't get it to work using the attach to node directly method.

Thanks for all the help as usual!

Take a look at the Rigid test as it does not use setGeometry and that might help. It’s probably related to where the translation is in regards to the rotation. Does the particle always emit from the top? perhaps the translation is not being modified by the rotation.

:smiley:



It works now!



I moved my transformations to the TriMesh rather than the node as done in the demo.





Thanks Renase!