A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Nearest Object Tracer for Pseudo Reaction Diffusion
Posted: 23 November 2016 11:53 AM   [ Ignore ]  
Total Posts:  10
Joined  2016-10-27

Hey

I’m wondering if there is a way to make the native Tracer in C4D able to connect objects based on their distance? So instead of the Tracer index governing the point order, it is in fact based on the distance from each object to the other…

The reason I ask is because I want to natively create coral growing on a surface… I figured that I could clone objects onto a rock, use the Push Apart Effector to space them evenly, play with Shader Effector and it’s visibility options, then trace the cloned objects on the rock with a delaunay tracer so the spline never intersects the rock volume and is always traversing randomly across the surface.

How would I do this? I’m assuming I could use Xpresso to change the index within the tracer based on object distances from each other… Would this be possible?

Kind regards,

Hayden Martin

Profile
 
 
Posted: 23 November 2016 05:21 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Hayden Martin,

Why not starting from the end. Create a Voronoi-Mesh.

Wrap this around a Landscape set to Object>Spherical. Wrapping is done with the “Surface Deformer”.

It needs to start with a single Polygon, to create only N-Gons. Perhaps in a wide to hight 2:1 ratio, to wrap nicely.

Adjust the points in the Voronoi Fracture.

Use the “Current State To Object”, and “Select Children”, then “Connect and Delete”.

Perhaps some points are too close, use the Optimize Function with a larger Tolerance.
Perhaps use “Triangulation”, and “Spin Edge” To get your favorite mesh. Some cuts (Knife) might needed.

After Wrapping (Surface Deformer), “Current State To Object, and perhaps if needed, fix the seam.

Place the clones on the Vertex Points and use the “Push Apart Effector”.

This might work here in my sketch, but I do not know your amount, size and other parameter.

So, I leave it here as a “Brainstorming”.

BTW. You could create two, one as surface/clones and one for the “delaunay-mesh”. Offset in the Surface Defomer.

I guess all steps to use edges for the effect is then a question of taste.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 23 November 2016 08:18 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Here is the XPresso version of it. Just ten Nulls randomly in space and the XPresso is checking the distance based on the slider [HUD], as example/sketch.

If the distance is zero or above the slider settings, both spline points will be set to 30,000, to be out of the way. One could also set them elsewhere or disable them.

Anyway, I hope that gives to each and every Null a connection in a certain distance, and not a spline to itself,  a zero distance or above the distance [Formula-Node]. The fomula node reads cryptic, but it is just a triple/nested “If” condition. (edit, two conditions would have been enough - but three works as well. The splines are doubled, the min needed number would be less Total(npwr2-n)/2, whereby the n would be the amount of max points to connect. The simplest way to overcome double connections, e.g. from point 2 to 5 and from 5 to2, is to cound each time one less “per row or object” see image
https://www.amazon.com/clouddrive/share/fwxkZrstQFz67m2UoZEF0y8hzMHigyTaSDovJAgZOVC?ref_=cd_ph_share_link_copy
just a sketch ;o) /edit)

If a Null is moved, the connection will update based on the settings.

To have it all in one Spline, merge all the Splines in the Scene and address the Segments with the proper point number, if one Spline and active is needed, otherwise one could connect the final state.

All the best

Example:
with two point Splines (simpler)
https://www.amazon.com/clouddrive/share/HwzaRn3PrZ79T6G9fEHgXXCqhCYf7YjsspzhbA3N4wl?ref_=cd_ph_share_link_copy
with one Spline Object, many segments
https://www.amazon.com/clouddrive/share/OjMIPXmrJpcNI2Omjio6RqTkyJjAOHU2IwHJj80BEPH?ref_=cd_ph_share_link_copy
Screenshot:
https://www.amazon.com/clouddrive/share/gEpX9FWVvMAh5EYFBRHV34BcDeP1jgnD7OV0s8385Dt?ref_=cd_ph_share_link_copy
One minute overview clip:
https://www.amazon.com/clouddrive/share/co8o4QSRakIjv4lhXpNlb2ro2vUA6BZ9OKEdCOVOJtS?ref_=cd_ph_share_link_copy

P.S.: I guess this is perhaps better in Python, where one can create and kill objects.

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 28 November 2016 04:57 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

A MoGraph XPresso version.

Please have a look here for a preview with twenty clones:
https://youtu.be/MxzrxR61RgU

Here is a sketch for five Clones. Just press play and watch, perhaps after a few runs use the HUD slider.
(See post above for the idea of the 5by5 version)
I have set up a nested iteration, where with each step of the parent iteration the child iteration counts one step less. In this way the up to ten of the twenty-five needed are defined. (n*n vs n*n-n [or less based on distance]

No double splines among clone pairs.

It would be great to set this up as a Python script, where nested loops are simple and the option to define (create as well kill) spline/segments is possible. In XPresso I have to set them to zero [vector] for the two position points, instead of killing the fifteen+ not needed splines (or segments). Without distance evaluation it would be a fixed number of 15.
With a Python script the number of clones could be variable as well.

My best wishes

Here is the file: [separate Splines]
https://www.amazon.com/clouddrive/share/aGzTCyG6I4OYZr3sJXKDGwLt9vQ59I28bH1GapRAO8N?ref_=cd_ph_share_link_copy
One spline with segments
https://www.amazon.com/clouddrive/share/PF35qYPTeVVlPA6Jsvfo5dGXMsAkaniNYRMPm9WCBPL?ref_=cd_ph_share_link_copy
Screen-shot of the segment version
https://www.amazon.com/clouddrive/share/Ih0mOdADCv9KZnnZ3ZsKQNecbTwIvuIwKQb9Un7yuh9?ref_=cd_ph_share_link_copy
[I’m not happy with the motion blur (Physical), though. Please test anything in detail. Sub-Frame Motion Blur seems more stable]

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile