Activity › Forums › Maxon Cinema 4D › Pdeflector – count collisions?
-
Pdeflector – count collisions?
Posted by John Hammond on September 24, 2009 at 10:16 amHi, I’m using a Pdeflector with some Xpresso.
Is there a way to ‘count’ the number of collisions and output this value in xpresso?
John
John Hammond replied 16 years, 7 months ago 3 Members · 9 Replies -
9 Replies
-
John Hammond
September 24, 2009 at 3:11 pmOr failing that, I have found that I can output the Position of where particles hit my deflector.
Now if I had a counter node that simply counted up each time it sensed the input had changed, I’d be OK.
Is there such a node that counts up as it detects the input changing? I’ve used this kind of node in other software..
-
Adam Trachtenberg
September 24, 2009 at 4:20 pmI don’t think there’s a counting node. It may be possible by way of the memory node, but that’s a bit above my pay grade. 😉
However, I did figure out a way to do it by changing the particle group upon collision and then outputting the particle count of the resulting group. File is here: https://www.3danvil.com/tutorials/group_chg_count_collisions.c4d
-
John Hammond
September 24, 2009 at 4:44 pmHi Adam, thanks for the response, I’ll check it out.
Incase you were interested I am trying to simulate a Lorenzian Waterwheel – Random Chaos:
https://www.youtube.com/watch?v=zhOBibeW5J0&feature=player_embedded
I basically need to ‘fill a bucket’ when the bucket passes under the central area, and let it slowly empty at all other times.
I didn’t get anywhere with the TP approach (though I’ll check out your link now).
Right now I’m trying out some Xpresso that says ‘If bucket is between x -100 and x 100, then mass = 4, else mass = 3.
–I am using Dynamics for the waterwheel rig–
So far my waterwheel acts a little random but then settles. I want infinite randomness though! I could achieve the effect other ways I am sure, but I am interested in the Maths and would like to explore it with C4D.
-
John Hammond
September 24, 2009 at 5:25 pm‘ve had a go at re-making your TP counter in my scene.
I got stuck at the PGroup node.
In yours you have outputs on the node, but I can’t find any outputs on my PGroup node, it’s as if it has none..
Here’s my scene https://www.sendspace.com/file/y9fovh
Regards,
John -
John Hammond
September 24, 2009 at 7:27 pmAh-ha, progess!
Turns out there are two PGroup nodes, one under ‘standard’ and one under ‘helper’. I had the wrong one.
Now to figure out how to make the ‘water’ (mass) drain out of the buckets. I need to subtract, say 1, from the mass as each frame passes.. hmm
Thanks for the file you provided, I could never have figured that out!
John
-
Brian Jones
September 25, 2009 at 2:39 pmoutside of trying to remember values in the xpresso you could use a null in the scene and add 1 to it’s Y position (for example) for every collision, just reads the null’s Y position to get hit count. Subtract from it’s Y position on a per frame basis for draining. Put a condition in to never let it get less than 0….
-
John Hammond
September 25, 2009 at 3:30 pmThanks for the help Brian,
I’ve been making some slow progress with this.
When you say “Subtract from it’s Y position on a per frame basis for draining” ..I’m unsure about how to tell Xpresso that I want to repeat the subtraction each time a frame passes.. I can only get it do the operation once.
-
Brian Jones
September 25, 2009 at 8:27 pmHere’s a quick example. There are some remarks in there about what the chunks do but not much explanation. Ask for details if you need.
-
John Hammond
September 28, 2009 at 10:41 amThanks Brian,
I’ve had a good look at the Xpresso and I think I understand what is happening. I’ll try to incorporate this into my project and post the results.
John
Reply to this Discussion! Login or Sign Up