0 like 0 dislike
348 views

Hi, here's my problem

I have a scene very similar to the Pk_sphere example, where a particle spawn some children particle when he "collide" with a target (using a spatial layer)

https://s28.postimg.org/arxgsnd19/shot_161216_114817.jpg

The parent.AxisUp is give from the   Sphere.samplePosition() on a sphere

Now, the particle spawn in the correct direction and following the normal of the sphere, this work great with the exagon of the example, but i'm using a long texture from Impact_Laser.dds, and it clearly doesn't work.

I need to rotate the billboard (they are set on PlanarAlignQuad) on the z axis and the y axis. I tried to modify the Axis float3  but it doesn't work, so I added a particle_rotation_Evolver and now i can modify the rotation of the billboard... but only on X axis, the only one I don't care. I look on the wiki and saw that AxisRotationSpeedField in the evolver should define the rotation axis, but it doesn't seem to do anything.

https://s30.postimg.org/9xirz09s1/shot_161216_120655.jpg

Am I missing something?

by

1 Answer

0 like 0 dislike
 
Best answer

Hello Frederico,

To rotate a PlanarAlignQuad, you have to rotate both axis on which the quad is aligned.

For example, if you have this configuration on your planar aligned billboards:

You can use an evolver script like this:

function void    Eval()
{
    float     rotationSpeed = 2.0;
    float3     rotationAxis = float3(0, 1, 1);

    Axis1 = rotate(Axis1, rotationAxis, rotationSpeed * dt);
    Axis2 = rotate(Axis2, rotationAxis, rotationSpeed * dt);
}

To get the particles to rotate around the axis "rotationAxis"

Hope this helps!

Cheers

by Paul (8k points)
Sorry, but i can't get this work properly. I also recreate your situation in a new and clean scene, but the particles doesn't show.

I'm wondering, why there is a variable in its own definition? (talking about axis1 and axis2)

and what exactley is "dt"?

Also, ma corcern is that, even if the particle work, i need them parented to the sphere where they are generated, in fact now the axis is defined as:

 Velocity = ((parent.AxisUp/GlobalScale) + vrand() * 0.6);
  

  
  AxisUp = normalize(Velocity);
  Axis= float3(0,0,1);
Axis1 is the first axis on which your particle will be aligned and Axis2 is the second alignment axis.
dt is the time elapsed since the last frame so that the speed of the rotation does not depend on the frame rate.

In my example, I have defined:
Axis1 = scene.axisUp(); // The side axis of the particle
Axis2 = scene.AxisForward(); // The normal of the particle

In your effect, look at the AxisField and Axis2Field in the billboard renderer (like in the screenshot I have sent you).
What do you mean by they need to be parented to the sphere?
I guess what you are saying is that you want the rotation vector to be dependent on the sphere position?
ok, it wasn't exactly the situation I was looking for, but it help me to fix the scene.

Thanks
...