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
   
 
Modulo in two directions
Posted: 11 November 2020 06:58 PM   [ Ignore ]  
Total Posts:  434
Joined  2012-01-05

Hello
I’m working on simulating a light installation.  I have it here in Redshift, I hope that’s ok?  Technically it is possible to see what I’m running into just by looking at the cylinder objects.

Basically I’m trying to have every other light beam facing one direction, and every other facing the opposite direction.
I can do the first part with a Plain Effector and a formula field with a modulo expression.

I tried adding a second formula field to have the non-rotated clones rotate in the other direction, but I think I might be doing something wrong…

Thanks for any suggestions

Scene file
https://www.dropbox.com/s/t1ndqbh54g33gbs/LightArray.c4d?dl=0

Profile
 
 
Posted: 11 November 2020 07:27 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Alex,

Yes, Redshift 3D is always fine. I might reduce it to a Cinema 4D only, so everyone can see how it works.

Thanks for using DropBox and the file; very much appreciated.

Two options:
The first is to use two objects under the cloner. they are set up to be in the opposite direction. (If that would be a more complex object: Symmetry> Flip).
With two objects under the Cloner and Clones> Iteration selected, they naturally “look” into opposite directions, even with the target.

The second option is to avoid a second Formula, and use
?(mod(id;2)=0;1;0)
Instead, while the R.H is set to 180ยบ. This makes certain that one rotation and the other not. The last two numbers in the formula define how much (100% or 0%) is used from the Effector’s Parameter. Those numbers can have any value.
The Formula reads as: If mod 2 equals zero, then the value given is 1, otherwise use zero.

I have attached two project files showcasing this.
https://www.amazon.com/clouddrive/share/rErcYSQ0mHZ8i6P93zlK2hG918k0YFT7pLrmVhszbho

Let me know if that works or if I have missed something.

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: 11 November 2020 07:51 PM   [ Ignore ]   [ # 2 ]  
Total Posts:  434
Joined  2012-01-05

Thanks Sassi!  This is really close, but I tried adapting it to what I want to do and I ran into an issue
See here
https://www.dropbox.com/s/52ymlp2yhiu2uc0/CV2_R23_drs_20_MGfs_01_AC.c4d?dl=0

Basically I disabled the target because in this particular case I want the shapes to just “oppose” each other.  So every other one is facing 45degrees towards the next one, and the next one is facing 45 degrees towards the previous one (so each pair is like an “X”).
I modified your formula a bit to use
?(mod(id;2)=0;1;-1) - didn’t work
?(mod(id;2)=0;1;-45) - opposite of the 45 degree angle but no luck
?(mod(id;2)=0;1;-90) - also thinking I had to double to the counter rotation but no luck…

I hope this makes sense…Thanks!

Profile
 
 
Posted: 11 November 2020 08:05 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Alex,

Please have a look here:
https://www.amazon.com/clouddrive/share/xpv1kFmEH0lR7EGVvMVubxDOcjlW40CC8wE3L7a485j

The last two numbers in the formula express how much the values in the Parameter (effector) are used. So -1;1 is the correct way to use the full and the opposite value.
If you go with a negative, the clamp needs to be shut off. (Image, right lower corner)
Your file back
https://www.amazon.com/clouddrive/share/xpv1kFmEH0lR7EGVvMVubxDOcjlW40CC8wE3L7a485j
Is that working?

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: 11 November 2020 09:07 PM   [ Ignore ]   [ # 4 ]  
Total Posts:  434
Joined  2012-01-05

Ah!!! Perfect, thank you Sassi, totally forgot about the clamp.

Thanks again, this is great

Profile
 
 
Posted: 11 November 2020 09:34 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Yes, Alex, that clamp! It should flash the first ten seconds of using the Fields.

Let me know if there is something else; I’m happy to look into it.

My best wishes for your project.

 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