Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make particle face camera?
#1
hi, I want to increase the size of the ends of my rope as shown below.
   

My code is as follows.

Code:
        var active_Rope = rope;

        if (active_Rope == null || solver == null)
            return;

        // index of the first particle in the actor:
        int FirstParticle = 0;
        int LastParticle = active_Rope.activeParticleCount - 1;

        int SecondParticle = 1;
        int SecondLastParticle = active_Rope.activeParticleCount - 2;


        Vector3 EndsShape = Vector3.one;

        solver.principalRadii[active_Rope.solverIndices[FirstParticle]] = EndsShape * RopeEndsThickness;

        solver.principalRadii[active_Rope.solverIndices[LastParticle]] = EndsShape * RopeEndsThickness;

        solver.principalRadii[active_Rope.solverIndices[SecondParticle]] = EndsShape * RopePreEndsThickness;

        solver.principalRadii[active_Rope.solverIndices[SecondLastParticle]] = EndsShape * RopePreEndsThickness;

While this scales up the particle, the particle does not scale uniformly as shown in the image above.
My rope is rendered on a secondary camera that using a culling mask and camera clear flags set to "Depth Only", so that my ropes always render infront of all other objects.

goal is that I want the ends of the rope to be scaled up and face the camera always, so it looks clear and uniform. (As shown in the above image) 
How can I achieve that effect?
Reply
#2
Hi!

I’m not sure I understand the question, the image shows 3 ends all uniformly scaled. Particles in a rope are always spherical.

For the same reason, it makes no sense to make a particle “face the camera”, since they’re radially symmetric: no matter how they’re facing, they will look the same.

Keep in mind that ropes do not model orientation, (unlike rods) so you can’t explicitly choose the orientation of a single particle.
Reply