Obi Official Forum
How to make particle face camera? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: How to make particle face camera? (/thread-3128.html)



How to make particle face camera? - linkinb - 12-10-2021

hi, I want to increase the size of the ends of my rope as shown below.
[attachment=1129]

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?


RE: How to make particle face camera? - josemendez - 12-10-2021

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.