Newbie: randomly color changing faces of a polygon

Forum for: Modelling, Texturing, Animation, Composting and the whole general usage of Cinema4D.

Moderatori: Arkimed, natas, visualtricks, cappellaiomatto

  • Advertising
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

Hello,

I modeled a triangulated robotic lion face which I'll use for my projection mapping. I wanted every triangular face of the polygon object to randomly change colours (not gradual but sudden) between five colors that I chose. So for example while one face goes cyan-pink-white; the other goes pink-white-cyan, and at different speeds so that the faces don't change color at the same time.

I tried a lot stuff with my little knowledge, but I couldn't figure out the main steps that I should take.

I would really really appreciate if someone could help me out with this.

Thanks a lot!

Mete Kutlu
Avatar utente
cappellaiomatto
Moderatore
Messaggi: 1571
Iscritto il: lun mag 07, 2012 5:12 pm

Re: Newbie: randomly color changing faces of a polygon

Messaggio da cappellaiomatto »

metekutlu ha scritto:Hello,

I modeled a triangulated robotic lion face which I'll use for my projection mapping. I wanted every triangular face of the polygon object to randomly change colours (not gradual but sudden) between five colors that I chose. So for example while one face goes cyan-pink-white; the other goes pink-white-cyan, and at different speeds so that the faces don't change color at the same time.

I tried a lot stuff with my little knowledge, but I couldn't figure out the main steps that I should take.

I would really really appreciate if someone could help me out with this.

Thanks a lot!

Mete Kutlu
Hi mete

This link could be a good start point

http://vimeo.com/31325419

You should use xpresso to change material selection programmatically
In the video you will see some balls that change material at collision with the ground....when you understand how to change material of object replace the collision node in xpresso with other nodes that test the current frame number in base of your desired logic.

Hope this help
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Re: Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

Yes, it helps a lot! Xpresso certainly looks amazing. A little like Grasshopper for Rhino. I'm looking into it right now.

Thanks Matteo.
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Re: Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

So, I made a simple xpresso expression. Instead of the collision node, I used random integer node to generate random material indices. My only problem is that it is generating them at each frame. How could I make the random integer node give me integers at certain intervals such as every 10 frames?

Thanks
Allegati
xpresso 01.jpg
Avatar utente
cappellaiomatto
Moderatore
Messaggi: 1571
Iscritto il: lun mag 07, 2012 5:12 pm

Re: Newbie: randomly color changing faces of a polygon

Messaggio da cappellaiomatto »

metekutlu ha scritto:So, I made a simple xpresso expression. Instead of the collision node, I used random integer node to generate random material indices. My only problem is that it is generating them at each frame. How could I make the random integer node give me integers at certain intervals such as every 10 frames?

Thanks
Cinema launch Every xpresso expression at each frame as you note.
Search from the nodes the time and with math operator check that
Frame property module 20 (for example) =0

If true it means that elapsed 20 frames....this could be the main logic more or less

Modules is math operation that mean the rest of division by a number
Es:
8 modules 5 = 3
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Re: Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

Math always saves lives! It is working. I just added a NOT after Math:Module, and then connect it to the Enable Port of the Random Integer. Thanks for being so clear and helpful. Here you can see the model. As my last question; would you propose I make selection tags for groups of faces and apply variations of this xpresso or is there any other fancy way?

(I certainly loved C4Dzone)

Bests,

Mete Kutlu
Allegati
lion.jpg
lion.jpg (109.54 KiB) Visto 3187 volte
Avatar utente
cappellaiomatto
Moderatore
Messaggi: 1571
Iscritto il: lun mag 07, 2012 5:12 pm

Re: Newbie: randomly color changing faces of a polygon

Messaggio da cappellaiomatto »

metekutlu ha scritto:Math always saves lives! It is working. I just added a NOT after Math:Module, and then connect it to the Enable Port of the Random Integer. Thanks for being so clear and helpful. Here you can see the model. As my last question; would you propose I make selection tags for groups of faces and apply variations of this xpresso or is there any other fancy way?

(I certainly loved C4Dzone)

Bests,

Mete Kutlu

Very Nice!!
:idea:

The selection Tag is the fastest and easiest way ..... there is also another way but more complicated with Vertex Map and Material channel layer but it is very long.
I saw very interesting tutorial using it for making burn effect on poly....go to youtube and search vertexmap texture cinema 4d

;)
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Re: Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

hey thanks a lot matteo! I attached the result for now. I'm very happy with it. I wanted to ask you if it's possible to make an animation with only visible edges (moving, being drawn in many ways), if it's complicated i prefer to do it in after effects then combine the animation? check out the scene! thanks.
Allegati
lion 04.c4d.zip
(147.35 KiB) Scaricato 163 volte
Avatar utente
cappellaiomatto
Moderatore
Messaggi: 1571
Iscritto il: lun mag 07, 2012 5:12 pm

Re: Newbie: randomly color changing faces of a polygon

Messaggio da cappellaiomatto »

metekutlu ha scritto:hey thanks a lot matteo! I attached the result for now. I'm very happy with it. I wanted to ask you if it's possible to make an animation with only visible edges (moving, being drawn in many ways), if it's complicated i prefer to do it in after effects then combine the animation? check out the scene! thanks.

:idea:

You're welcome and thank you too for sharing with our comunity your scene file

:P

When I will be free for five minutes I will watch your result...I'm very curios to see the final result...now I'm very busy with Master Cinema 4D course

:mrgreen:

I don't understand your request....What do you mean for "make an animation with only visible edges" ??
metekutlu
Messaggi: 6
Iscritto il: mer set 12, 2012 3:43 pm
Località: Paris

Re: Newbie: randomly color changing faces of a polygon

Messaggio da metekutlu »

I just saw the courses, it's great. As for my question, I wanted to animate the edges of the faces. For example, edge lines being drawn from the center of the object or a line(s) moving on the edges. I can do it in after effects but if it's possible in c4d it would be much proper.
  • Advertising
Rispondi