Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
MAXON CINEMA 4D: Cinema 4D ForumCinema 4D TutorialsCinema 4D TagAdobe After Effects Forum

Pdeflector - count collisions?

Cow Forums : Cinema 4D

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Pdeflector - count collisions?
by John Hammond on Sep 24, 2009 at 10:16:56 am

Hi, 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





Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by John Hammond on Sep 24, 2009 at 3:11:43 pm

Or 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..

Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by Adam Trachtenberg on Sep 24, 2009 at 4:20:53 pm

I 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: http://www.3danvil.com/tutorials/group_chg_count_collisions.c4d

Respond to this post   •   Return to posts index


Re: Pdeflector - count collisions?
by John Hammond on Sep 24, 2009 at 4:44:26 pm

Hi Adam, thanks for the response, I'll check it out.

Incase you were interested I am trying to simulate a Lorenzian Waterwheel - Random Chaos:







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.

Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by John Hammond on Sep 24, 2009 at 5:25:20 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 http://www.sendspace.com/file/y9fovh

Regards,
John

Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by John Hammond on Sep 24, 2009 at 7:27:47 pm

Ah-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

Respond to this post   •   Return to posts index


Re: Pdeflector - count collisions?
by Brian Jones on Sep 25, 2009 at 2:39:11 pm

outside 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....

Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by John Hammond on Sep 25, 2009 at 3:30:56 pm

Thanks 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.


Respond to this post   •   Return to posts index

Re: Pdeflector - count collisions?
by Brian Jones on Sep 25, 2009 at 8:27:31 pm

Here'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.

Respond to this post   •   Return to posts index


Re: Pdeflector - count collisions?
by John Hammond on Sep 28, 2009 at 10:41:49 am

Thanks 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

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]