About Store Forum Documentation Contact



Post Reply 
Particles not using matrix direction?
Author Message
fatcoder Offline
Member

Post: #1
Particles not using matrix direction?
It appears as though particles don't use the direction (orientation) of their matrix, only the position. Is that right?

For example, add the following code to the Particles tutorial in the Update() function.

Code:
particle[2].matrix.setRotateY(Time.time());
particle[2].matrix.pos = Vec(0.5f,0,0);

I would expect this to cause the water particle effect to rotate around the y axis, but it doesn't.

Is this a bug or a limitation? Is it possible to allow particle effects to use their matrix orientation?

There are often cases where you have a particle effect set up to fire particles in local space, such as down the z axis for example. You then want to be able to place this and orientate it in world space, but can't do it.
04-09-2013 02:43 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #2
RE: Particles not using matrix direction?
(04-09-2013 03:13 AM)aceio76 Wrote:  I've never been able to rotate the matrix orientation by calling setRotate so I never use it. Try matrix.orn().rotateYL();

You've most likely been doing it wrong then. lol Anything that starts with "set" will reset the matrix, which I think trips a lot of people up that don't know or forget.

Anyway, how you choose to rotate your matrix is irrelevant. I'm not actually using the above code, it is just an example to illustrate the problem with the particles not working with matrix orientations.
04-09-2013 07:37 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: Particles not using matrix direction?
Sorry, my intention was not to offend, hence the laughing simile. Its just that you said, "I've never been able to rotate the matrix orientation by calling setRotate." So I just assumed you must be doing something wrong (i.e. wrong call order, or other calls after the set) as I've never had any problems with setRotate?

Try putting the following code into the Particles tutorial, in the Update() function and tell me if the water particle effect rotates for you?

Code:
particle[2].matrix.orn().rotateYL(Time.time());
particle[2].matrix.pos = Vec(0.5f,0,0);

I'm curious though what you mean by, "I'm actually using that code to rotate particles continuously." Are you using the built-in Particles or RawParticles? Do you mean individual particle rotation or rotation of the whole system (which is what I'm talking about)?
04-09-2013 04:13 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Particles not using matrix direction?
matrix affects only generation source shape of the particles
for particles[2] in the tutorial they are affected by strong velocity (2,2,0)
the velocity is not transformed by matrix but it's in world space
you may want to set velocity transformed by the matrix
04-11-2013 08:19 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #5
RE: Particles not using matrix direction?
Hmm... That doesn't sound quite right. If you go into the Particle Editor tool and create a particle with a box source shape, you can freely move the box around and even scale it. However the rotate tool doesn't work on it. You can't rotate the box??

The particle "velocity" is in local space to the particle system itself. But when you place the particle effect in the world, you want to be able to position and rotate it in world space. It doesn't make any sense to adjust the particle's local space velocity in order to produce a world space effect??
04-12-2013 01:01 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Particles not using matrix direction?
Quote:If you go into the Particle Editor tool and create a particle with a box source shape, you can freely move the box around and even scale it. However the rotate tool doesn't work on it.
Box shape does not have orientation.
If you want box with rotation, then please use Oriented Box shape.

Quote:The particle "velocity" is in local space to the particle system itself
no, it's in global space
04-17-2013 01:02 PM
Find all posts by this user Quote this message in a reply
Post Reply