Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Particles; & vectors
Topic Started: Dec 2 2007, 04:39 AM (204 Views)
ashrat3000
Member Avatar
u3d raytracer
[ *  *  *  *  *  * ]
I'm having a problem with particles. What I want to happen is when I shoot the floor, the particles should jump up. When I shoot the ceiling, the particles should jump down. If I shoot a diagonal polygon, The particles should jump along the normal to the polygon.

I got that working, but all the particles follow the same path. I want the particles to spread a little and not all go in exactly the same direction.

Code I have:
Code:
 
ROTY=90+point_direction(0,0,global.normalx,global.normaly)
ROTX=+radtodeg(-arcsin(global.normalz))
if hit = 'terrain'
{
SetParticleVelocity(ROTX,ROTY,20,ROTX,ROTY,150)
SetInitialParticleColor(60,60,60,100,120,120,120,120)
SetFinalParticleColor(60,60,60,10,120,120,120,10)
SetParticleAcceleration(90,0,010.81,90,0,010.81)
alarm[0]=15;


What I've tried doesn't work so far.

And a side question: How do I put friction on the particles, not gravity? Or maybe gravity and friction.
그대를 사랑해


Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
This should do it:
Code:
 
SetParticleVelocity(ROTX-10,ROTY-10,20,ROTX+10,ROTY+10,150);

To get friction create a modifier with a big area of influence (set parameter SecondSphereRadius 0 and the scaling parameters to something very big) and set up a velocity factor for this modifier.
Offline Profile Quote Post Goto Top
 
ashrat3000
Member Avatar
u3d raytracer
[ *  *  *  *  *  * ]
Right, I tried that, but what happens when I shoot the floor is this:
Code:
 

              |
             |
            |
           |
          |
         |
        |


Rather than this:
Code:
 

         |
         |
         |
         |
         |
         |
         |


Also, thanks with the friction.
그대를 사랑해


Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Hmm, yeah I see why this is happening. Here's an alternative solution: Make the particle origin a small sphere and set up an initial center repulsion. This should work better.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply