• You are not logged in. | Login

Post a reply

#1    February 8, 2010 8:10 pm

Saxcore
Member
Ranks
United Kingdom
Gender:
From: Bournemouth & Oxfordshire, UK
Registered: November 23, 2009
Posts: 53
Reputation :   
Visit website

Collision question

Hi there.

I'm currently (still) in the process of creating a bunch of scripts that assign a particle to each vertex of a mesh, then as the mesh moves, an event script moves the particles to the new position of the vertex it has been assigned to. This event script also looks out for collisions, and any particles that collide with anything are "moved" to a separate emitter that is fully dynamic (then they fall from the body of fluid, splash around, etc).

Now, I have been having problems when moving my "target" mesh into other objects to create collisions. For some reason, no matter what the level of substeps, the guided particles would pass right through the collision object (I have turned collisions off for the "target" mesh, but not for all other objects .. if you get my idea). However, when I keep my target mesh stationary, and move collision objects into it, everything works fine; all of the collided particles transfer to the second emitter, turn dynamic etc etc.

One thing I haven't mentioned about my script is that it constantly nullifies the velocities of the particles within the first emitter, to make sure they follow the mesh perfectly.

My question is on the way that collisions with particles vs. collision objects are solved in Realflow; I was wondering, are collisions worked out by comparing velocities of two objects, rather than comparing positions? If so, the reason that moving my particle target mesh into a collision object doesn't create collisions makes sense:

- Firstly, the collision object is not moving, and therefore does not have a velocity.
- The particles have no velocity despite being the moving entity. They are moved by literally being picked up and placed on their target vertex. I then remove their velocity anyway.

So, having 0 velocity between the particles and the object means no collision calculated!

So, if the above is correct, would a better method to move the particles be to "guide" them, by looking at their velocity, and applying a new velocity to counter-act this velocity, and also get them to exactly the correct position (their relevant vertex)?

... Sorry if this question is too scripting related. You can move it to the scripting forum if you like! I just thought it was more of a "theoretical" question. I also hope it all makes sense.

Cheers, Sam.


 

 

#2    February 8, 2010 8:30 pm

Saxcore
Member
Ranks
United Kingdom
Gender:
From: Bournemouth & Oxfordshire, UK
Registered: November 23, 2009
Posts: 53
Reputation :   
Visit website

Re: Collision question

....just altered my script to take into account my new idea. That was a lot easier to implement that I thought...

However, while everything seems to be "working", that didn't seem to fix the problem. I think there is something else afoot here...

EDIT: It turns out you have to save your event script before re-simulating for it to be taken into account! It's now working by manipulating velocities, not absolute positions, and thus is allowing all collisions. Better.

However, the particles aren't following the target mesh particularly close. There seems to be a fair bit of lag between the movement of the mesh and the particles... see next post.

Last edited by Saxcore (February 9, 2010 11:54 am)


 

 

#3    February 8, 2010 11:44 pm

Saxcore
Member
Ranks
United Kingdom
Gender:
From: Bournemouth & Oxfordshire, UK
Registered: November 23, 2009
Posts: 53
Reputation :   
Visit website

Re: Collision question

Hi. I'm really sorry for chaining posts together, however, it's almost there; Now I'm just fiddling with the basic concept of velocity in RF.

I would have thought that a velocity vector of x amount in a given direction would mean that the particle will move this much in the next frame (or, any other unit of "time"; i.e. a substep). For example, say a particle is at the origin:

[0,0,0]

..and it has a velocity of, say, 1 in the X direction:

[1,0,0]

..it appears this doesn't mean in the next frame it'll have moved 1 unit in the X direction, to end up at the absolute position of:

[1,0,0]

I'm just wondering what it does mean? How is velocity used mathematically in RF?

..I realise how far off of the original topic this post is getting, and someone other than me is yet to respond. However, I'm having a bit of a breakthrough, so you'll have to excuse me!
smiley-smile

Last edited by Saxcore (February 9, 2010 12:12 pm)


 

 

#4    February 9, 2010 7:23 am

shaun_michael
Moderator
Moderator
United Kingdom
Gender:
Registered: September 10, 2006
Posts: 4778
Reputation :   95 

Re: Collision question

Not being a python champion Sam I probably wouldn't be able to contribute too much but I just wanted to encourage you to keep posting your thoughts and progress.  It makes very interesting reading.

As far as moving the thread to the python scripting section, we'll see how it goes and if it remains as it is now I'll switch it over, or simply make a thread referencing this one.

Shaun


 

 

#5    February 9, 2010 12:10 pm

Saxcore
Member
Ranks
United Kingdom
Gender:
From: Bournemouth & Oxfordshire, UK
Registered: November 23, 2009
Posts: 53
Reputation :   
Visit website

Re: Collision question

Hi Shaun.

Me neither. In fact, I'm not the biggest fan of Python, but that probably comes down to the fact that I don't know it too well. However, I've got some time to learn Python over the next week or two, so hopefully that will change.

Seeing as this thread is here to stay (for the time being at least), I've tidied up the previous posts a bit... I was mainly posting at key moments, so explanations were being left out.

I'm going to give the scientists at Next Limit an email about this velocity thing. When they get back to me, I'll post up my findings on here.

Cheers, Sam


 

 

#6    February 9, 2010 1:30 pm

shaun_michael
Moderator
Moderator
United Kingdom
Gender:
Registered: September 10, 2006
Posts: 4778
Reputation :   95 

Re: Collision question

You could also try your luck posting on the scripting forum site.  You may get a speedier response:-

http://www.nextlimit.com/phpBB2/index.php

Shaun


 

 

#7    February 9, 2010 7:49 pm

Saxcore
Member
Ranks
United Kingdom
Gender:
From: Bournemouth & Oxfordshire, UK
Registered: November 23, 2009
Posts: 53
Reputation :   
Visit website

Re: Collision question

Ah yeah, I'm yet to have a decent look at that site. I'll probably be on there crying next week, when I get further into this project.

As it turns out, Next Limit are pretty good at getting back to me these days! I emailed the tech desk, and apparently velocity in RF is equal to meters/second. This I find a tad confusing, because as far as I know, you can't adjust the simulation scale in RF like you can in, say, Maya's nucleus node. In RF, 1 unit of distance is always equal to 1 meter; adjusting the environment scale appears to be just for adjusting the scale of all imported meshes? However, correct me if I'm wrong.

So, I'm not sure why my script isn't working as it should. It looks like another night of testing is in order...

P.S. Is that link to the official Realflow ghost forum?

Last edited by Saxcore (February 9, 2010 7:52 pm)


 

 
  • Actions
  • Rules
  • Top