The particle rotation is affected by collisions and self collisions. The force does not affect the rotation. As well when not colliding particles will continue rotating based on the angularVelocityPP, which decays based on the rotationDamp. You can modify the angularVelocityPP to affect the particle rotations if desired, potentially by evaluating a field inside a particle expression, or a typical use would be to randomize in the creation expression.
For rotating smoke, as opposed to particle instancing, it can work to make the collide strength very low, and the particles large, overlapping and self colliding. This way the motion of nearby particles affects the rotation without being a hard collision, but instead a weak repulsion. We had also looked at implementing the rotation calculation for the liquid (sph) model, which is faster than self collisions and better for gaseous flows, but I don’t think it currently affects the rotation( but I could be wrong).
Duncan
--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
maya_he3d+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The particle rotation is affected by collisions and self collisions. The force does not affect the rotation. As well when not colliding particles will continue rotating based on the angularVelocityPP, which decays based on the rotationDamp. You can modify the angularVelocityPP to affect the particle rotations if desired, potentially by evaluating a field inside a particle expression, or a typical use would be to randomize in the creation expression.For rotating smoke, as opposed to particle instancing, it can work to make the collide strength very low, and the particles large, overlapping and self colliding. This way the motion of nearby particles affects the rotation without being a hard collision, but instead a weak repulsion. We had also looked at implementing the rotation calculation for the liquid (sph) model, which is faster than self collisions and better for gaseous flows, but I don’t think it currently affects the rotation( but I could be wrong).Duncan
From: maya...@googlegroups.com [mailto:maya...@googlegroups.com] On Behalf OfGary Jaeger
Sent: Wednesday, December 04, 2013 1:15 AM
To: maya...@googlegroups.com
Subject: [maya_he3d] nParticle rotation
I’m in the middle of trying to figure out how to channel nParticle rotation into krakatoa normals. But I realize I’m not exactly clear on nParticle rotation. Will nParticles rotate when affected by forces? Or do they need to collide before there will actually be rotation changes?Gary Jaeger // Core Studio
249 Princeton AvenueHalf Moon Bay, CA 94019
650 728 7060
http://corestudio.com--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email tomaya_he3d+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email tomaya_he3d+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
NormalDirPP isn’t used by anything by default(if you are not using Krakatoa)… particles have no orientation unless one is doing stuff like instancing. And for that there are a variety of ways of defining orientation that don’t involve a normal. If one enables rotation it automatically adds rotationPP and angularVelocityPP. The simulation then updates these based on collision. One can then use the rotationPP to drive particle instancer rotation, if desired. I’m not familiar with the way the Krakatoa plugin works… if you are going from Maya to Krakatoa and want to pass the NormalDirPP you could create the attribute and set it in an particle expression based on the rotationPP(if you want to use the nParticle rotation feature to drive the rotation values). It’s a little math to get the normal from the rotation.
Duncan
NormalDirPP isn’t used by anything by default(if you are not using Krakatoa)… particles have no orientation unless one is doing stuff like instancing. And for that there are a variety of ways of defining orientation that don’t involve a normal. If one enables rotation it automatically adds rotationPP and angularVelocityPP. The simulation then updates these based on collision. One can then use the rotationPP to drive particle instancer rotation, if desired. I’m not familiar with the way the Krakatoa plugin works… if you are going from Maya to Krakatoa and want to pass the NormalDirPP you could create the attribute and set it in an particle expression based on the rotationPP(if you want to use the nParticle rotation feature to drive the rotation values). It’s a little math to get the normal from the rotation.Duncan
If you just want them to spin at fixed rates you could just drive the NormalDirPP directly with some expression. If you want to apply impulses to the angular momentum then using the nParticle generated rotationPP values could be useful, but the math to convert the rotation to a vector is a bit complicated. There might be an existing mel function to call that could do it, but I can’t remember.
Setting the angularVelocityPP to a random value inside a creation expression is easy:
float $rotSpeed = 2;
angularVelocityPP = <<rand($rotSpeed), rand($rotSpeed), rand($rotSpeed>>;
For a fixed rotation expression (not using the nParticle rotation feature) you could perhaps define create two per particle vector attributes, in addition to NormalDirPP:
upPP, and twistPP.
Then in a creation expression set them to be a randomized orthogonal pair… this creates a basis for your rotation:
Vector $v1 = <<(rand(2)-1),(rand(2)-2),(rand(2)-1)>>;
Vector $v2 = <<(rand(2)-1),(rand(2)-2),(rand(2)-1)>>;
$v1 = $v1/mag($v1); // normalize
$v2 = $v2/mag($v2); // normalize
upPP = $v1;
twistPP = $v1^$v2; // crossproduct vector is orthogonal to v1
Inside a runtime expression you could then just set your rotation vector using the age as follows:
float $rotSpeed = 2;
NormalDirPP = upPP *sin(age * $rotSpeed) + twistPP*cos(age*$rotSpeed);
Note that I’ve not tested that expression… also “vector” should not be capitalized.
Duncan
From: Duncan Brinsmead
Sent: Wednesday, December 04, 2013 7:47 PM
To: maya...@googlegroups.com
Subject: RE: [maya_he3d] nParticle rotation
If you just want them to spin at fixed rates you could just drive the NormalDirPP directly with some expression. If you want to apply impulses to the angular momentum then using the nParticle generated rotationPP values could be useful, but the math to convert the rotation to a vector is a bit complicated. There might be an existing mel function to call that could do it, but I can’t remember.
Setting the angularVelocityPP to a random value inside a creation expression is easy:
float $rotSpeed = 2;
angularVelocityPP = <<rand($rotSpeed), rand($rotSpeed), rand($rotSpeed>>;
For a fixed rotation expression (not using the nParticle rotation feature) you could perhaps define create two per particle vector attributes, in addition to NormalDirPP:
upPP, and twistPP.
Then in a creation expression set them to be a randomized orthogonal pair… this creates a basis for your rotation:
Vector $v1 = <<(rand(2)-1),(rand(2)-2),(rand(2)-1)>>;
Vector $v2 = <<(rand(2)-1),(rand(2)-2),(rand(2)-1)>>;
$v1 = $v1/mag($v1); // normalize
$v2 = $v2/mag($v2); // normalize
upPP = $v1;
twistPP = $v1^$v2; // crossproduct vector is orthogonal to v1
Inside a runtime expression you could then just set your rotation vector using the age as follows:
float $rotSpeed = 2;
NormalDirPP = upPP *sin(age * $rotSpeed) + twistPP*cos(age*$rotSpeed);
Duncan