Formula ?

DUDUDUDU Posts: 1,945
edited December 1969 in Carrara Discussion

Hello,
I know a lot of things in Carrara, but there is a symbol which intrigues me since always… “Formula” !
Is there somebody who could explain in simple manner to what that is useful and what can one await from this option.
Thank you!

Formule.jpg
800 x 400 - 196K
«1

Comments

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    Just as the title implies, you enter in a formula, it creates the result. I've never tried this, but I found a topic on just what you're asking, if you're interested in learning ;)

  • DUDUDUDU Posts: 1,945
    edited December 1969

    Ah, if Einstein had known CARRARA !

    I just found this:

    http://docs.daz3d.com/doku.php/artzone/pub/software/carrara/06_six/22_using_formulas

  • DartanbeckDartanbeck Posts: 21,583
    edited October 2013


    Cool, 'cause I wasn't finding any fun at that link I've posted! This is much better!
    Post edited by Dartanbeck on
  • ramble1035ramble1035 Posts: 0
    edited December 1969

    This site is in French, but it lists some formulas and shows pictures of the results. Most them are pretty complex, but they give you a good idea of what's possible...

    http://gianp.free.fr/carrara/indexcarrara.html

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    This site is in French, but it lists some formulas and shows pictures of the results. Most them are pretty complex, but they give you a good idea of what's possible...

    http://gianp.free.fr/carrara/indexcarrara.html

    Excellent! That's exactly what I was looking for! But now I'll have to find a way to translate that main menu! :ahhh:
    Thanks for this!
  • DUDUDUDU Posts: 1,945
    edited December 1969

    Dart, I looked at all the links of this topic and I see only sites not very cool.

    Ramble, super!
    I suppose that, by making a “Copy/Paste” of the formulas and one will have the stuff automatically?
    I will test !

    Merci.

  • DUDUDUDU Posts: 1,945
    edited December 1969

    Dart, I have an advantage on you this time, French is my language!

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,228
    edited October 2013

    I actually fiddled with it once to do this
    two objects with the p2 sliders animated in reverse to each other
    r1=10*p1;
    r2=10*p2;
    t=2*PI*u;
    p=PI*(v-0.5);
    x=r1*cos(t)*cos(p);
    y=r1*sin(t)*cos(p);
    z=r1*sin(p);
    that is just the carrara torus formula BTW, I have no idea about maths!

    torus.gif
    533 x 300 - 4M
    Post edited by WendyLuvsCatz on
  • DUDUDUDU Posts: 1,945
    edited October 2013

    Waw !
    How are you animate it ?
    The formulas changing makes keyframes ?

    PS: the 2 sliders ? Cool !

    Post edited by DUDU on
  • WendyLuvsCatzWendyLuvsCatz Posts: 38,228
    edited December 1969

    no the sliders underneath and the bits under parse and more gives options

  • DUDUDUDU Posts: 1,945
    edited December 1969

    I know what I will do tomorrow Sunday, I will test all that!
    Thank you!

  • Rich GellesRich Gelles Posts: 0
    edited December 1969

    you know I have always seen the formula thingy and never really tried to make use of it ----It seems at first glance to have some powerful possibilities and seems maybe even a spot for some additional plugin help maybe?

    rich

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    you know I have always seen the formula thingy and never really tried to make use of it ----It seems at first glance to have some powerful possibilities and seems maybe even a spot for some additional plugin help maybe?

    rich

    I'm with you on that. But clicking on some of the links in that french page makes me want to try it more - so I bookmarked it. Once you click on a french word, it takes you to the Carrara settings (the same for most languages, I think....) with a visual example of what it creates. We're talkin' shaders, models, etc., very cool site!
    Now if only DuDu would find it in his heart to tell us which word means what, in English... well.... ;)
  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    Wendy that is super-cool!

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    you know I have always seen the formula thingy and never really tried to make use of it ----It seems at first glance to have some powerful possibilities and seems maybe even a spot for some additional plugin help maybe?

    rich

    I'm with you on that. But clicking on some of the links in that french page makes me want to try it more - so I bookmarked it. Once you click on a french word, it takes you to the Carrara settings (the same for most languages, I think....) with a visual example of what it creates. We're talkin' shaders, models, etc., very cool site!
    Now if only DuDu would find it in his heart to tell us which word means what, in English... well.... ;)

    At least the language of mathematics is universal! :)

  • Aave NainenAave Nainen Posts: 1,108
    edited December 1969

    This site is in French, but it lists some formulas and shows pictures of the results. Most them are pretty complex, but they give you a good idea of what's possible...

    http://gianp.free.fr/carrara/indexcarrara.html

    Excellent! That's exactly what I was looking for! But now I'll have to find a way to translate that main menu! :ahhh:
    Thanks for this!

    If you use Chrome web browser it will offer to translate for you!

  • PjotterPjotter Posts: 274
    edited December 1969

    http://translate.google.com/ Set the language > Past the url > click the link.

  • DUDUDUDU Posts: 1,945
    edited December 1969

    I speak French but in this case, the images are sufficient, one will not calculate formulas ourself !
    It would be nice if, in the next version of Carrara, that all these formulas were included like presets.

  • PjotterPjotter Posts: 274
    edited December 1969

    Found some more using Google: Carrara formulas

    Like this one: http://download.novedge.com/Brands/Eovia/Documents/Eovia_Carrara_Formula.pdf

  • JonstarkJonstark Posts: 2,738
    edited December 1969

    I've got to admit at this point that most of this is over my head, but I really think it's cool what formulas can do. That french site contains some very cool stuff, and I agree it would be nice if some of these were contained in Carrara as presets.

    Good find, pjotter, that pdf definitely helps explain things

  • DartanbeckDartanbeck Posts: 21,583
    edited October 2013

    Okay, so I've translated the French site, and it works, thank you Pjotter!
    Edit: I tried to just make an English link - but, alas, we must simply follow Pjotter's simple instructions, above, to translate to English

    Post edited by Dartanbeck on
  • TerritanTerritan Posts: 76
    edited December 1969

    By the way, if you have the Carrara 8 content installed, hit the Browser, go to the Objects tab, and scroll down. There should be five sample Formula objects, with animatable parameters.

    And you're just looking at the formula object.

    Now go into the Shader editor.

    Pick an element of the shader tree and pull down the menu.

    There's a "Formula" item in the "Pattern Functions" menu.

    Then go back to the Assembly Room, and set two keyframes in the Sequencer. Double-click the space between them.

    Hey, look at that! There's a "Formula" in the Tweeners menu (in the Parameters panel).

    In fact, hit page 415 of the manual that came with Carrara. Yes, I know, that's the Carrara 7 manual. This stuff has been around longer than that. And that page tells you, you can create not just formula objects, tweeners, and shaders, but deformers, light gels, backgrounds, and backdrops too.

    I was wondering when someone would rediscover this lost art, because I think you could squeeze a book or two out of this alone.

  • DartanbeckDartanbeck Posts: 21,583
    edited October 2013

    Territan is absolutely correct. There are quite a number of places where we may use formulas in Carrara - and it could certainly fill a good book.
    Let's have a quick look at this French page: http://gianp.free.fr/carrara/indexcarrara.html

    I cannot understand French at all. Thanks to Pjotter, pointing this out: we simply copy: http://gianp.free.fr/carrara/indexcarrara.html
    and paste it into Google Translator, the big box on the left. A link will appear in large letter on the right. Click on that and you now have an English translation of the whole site and all of it's links. (Thanks, Pjotter, once again)

    Edit: I just tried translating again and got unwanted results. I tried this translator site and it worked - http://www.freetranslation.com/
    If something screwy goes on with translation, just find another translator. Some work site-wide, like this, others only words or phrases. Again, establishes my urge to have a translated copy that I can keep.
    Something strange going on with my web - having trouble with translators. Posting an image of the main contents page translated for future use

    Using the descriptions, have a look through some of the examples by clicking on the number to the left.
    These shapes can be really valuable i computing all of these different areas Territan is mentioning. From subtlety to its complete opposite, this guide can give us some extreme examples of how different formulas will behave as a tweener, shader, modifier, or model.

    Since these are three dimensional formulas, I am understanding that the center of the resulting shape is 0,0,0 or absolute zero in three dimensional space. In RBG, zero equals Black as 255 = White. In a tweener the center will equal the data from the left side of the sequencer timeline, and the further away it gets from center, the closer it gets to the data on the right.

    Just a small rationalization to what's going on here.

    So with that in mind, you'll see that some of these formulas will give subtle results, perhaps, while many or most others will do something really special. I really need to translate this whole, amazing site and print it to book!

    FormulaFrenchTranslated_2.jpg
    602 x 567 - 84K
    FormulaFrenchTranslated_1.jpg
    602 x 586 - 93K
    Post edited by Dartanbeck on
  • TerritanTerritan Posts: 76
    edited October 2013

    Okay kids, here's a somewhat simplified formula to get you started:

    x=60*(u-0.5);
    y=p2*sin(x*20*p1);
    z=30*v;

    That'll produce a vertical plane. Move p1 and p2 off of zero, and you'll see it get wavy.

    Here's how to read what's going on here.

    First, you know how objects are UV-mapped, and how one corner is the 0,0 coordinate and the opposite corner is the 1,1 coordinate, and everything in between is some pair of decimals between those? That's what the u and v here are doing: Every value of U and V between 0 and 1 (in tiny increments) is plugged into the formulas. Whatever results come back, that's where Carrara puts a pixel, and that pixel will have that uv mapping.

    I flat-out multiplied v by 30 in order to get a vertical thing, running from z=0 to z=30.

    I subtracted 0.5 from u so it would go from -0.5 to 0.5 instead of 0 to 1. Then I multiplied that by how big I wanted the wall in the x axis, in this case 60. So the wall runs from x=-30 to x=30.

    y is admittedly a little more complicated, but much more interesting. I wanted a wavy quonset-hut type corrugated metal wall effect, so I want it to wave back and forth across the y-axis. So I set y to a value based on the sine of x (you know, like a sine wave?) so it would oscillate back and forth.

    Sorry, yeah, it does contain a little math. As the old saying goes, "Welcome to the Turing Tarpits, where anything is possible but nothing interesting is easy."

    I multiplied x by both 20 and p1 so I could control the rate of oscillation without changing the formula itself. After I had that number, I multiplied that by p2 so I could control how deep the waves were.

    You'll need to move both p1 and p2 off of zero, but when you do, you'll see it get wavy.

    Different formulas loop across different values using different variables, and use different variables for output. Again, the Carrara 7 manual has that information.

    Admittedly, the parser is a bit finicky (it doesn't like decimals that start with the period, for example), but this provides Carrara with the power to image any shape and effect you can define mathematically.

    Post edited by Territan on
  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    Territan said:
    Okay kids, here's a somewhat simplified formula to get you started:

    ~ with all this stuff ~

    Here's how to read what's going on here.
    ~ and all of this stuff ~

    This is so freaking cool I could just faint!
    Thanks for this!
  • TerritanTerritan Posts: 76
    edited December 1969

    Oh, and that vertical wavy thing that I wanted? The one that looked like corrugated metal?

    Here's what I wanted it for; I run games on G+, and I sometimes render my own event banners. This represents a change, in that this is the first one I did in Carrara.

    And while the formula unit is cool, it's hampered by a lack of examples.

    What we need... is a cookbook.

    Event-Banner-Corrugated.png
    1200 x 300 - 276K
  • TerritanTerritan Posts: 76
    edited December 1969

    Okay, here's another one.

    Lemme set the scene: A single plane on the floor, with no shader on it. A single spotlight, shining directly down on it. The picture should appear below.

    The secret to this colorful outburst?

    Select that light in the object list, then the Effects tab. There's a Formula in the Gel menu, and that formula is:

    red=1.0-pow(pow(u,2)+pow(v,2),0.5);
    green=pow(pow(u,2)+pow(v,2),0.5);
    blue=1.0;

    Here's a new twist: u and v range from -1 to 1 instead of 0 to 1. While that may seem silly, it does mean the point the light is aimed directly at is u=0 and v=0, which is kind of convenient for some math anyway.

    Blue, I simply set to 1.0 full intensity. Everything gets blue.

    Red and Green take some explaining. It's derived from the Pythagorean theorem. Remember x^2+y^2=z^2? That's the formula you use to determine the distance between two points: add the squares of the differences, and take the square root of that.

    Green is set to u^2+v^2, so the farther away from the center, the more green it gets. Green + Blue = Cyan.

    Red is 1 minus that value, so the closer to the center of the spotlight, the more red it gets. Red + Blue = Violet.

    So the light varies from a cyan outer ring to a violet center.

    Here's an even simpler gel:

    red=abs(u);
    green=abs(v);
    blue=1.0;

    Again, blue gets it all. Red and green gets the absolute values of whatever u and v are, respectively, so it's blue at the center and toward the edges... well, maybe I'll just let you guys work that one out.

    Peculiar_Spotlight.png
    360 x 270 - 22K
  • DUDUDUDU Posts: 1,945
    edited December 1969

    I follow this post considering I put the starting question, and really, I am extremely surprised to see that there are incredible possibilities with this option of Carrara!
    I was far from thousand miles to believe that there were some people so concerned with this possibility of creating objects, textures etc… with scientific formulas!
    Thank you for all those which like Carrara and want its promotion in the 3D world !

  • JonstarkJonstark Posts: 2,738
    edited December 1969

    Territan, I had to pick my jaw up off the floor. What excellent examples of how useful these formulas could be! You're right, we need a cookbook.... :)

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    I follow this post considering I put the starting question, and really, I am extremely surprised to see that there are incredible possibilities with this option of Carrara!
    I was far from thousand miles to believe that there were some people so concerned with this possibility of creating objects, textures etc… with scientific formulas!
    Thank you for all those which like Carrara and want its promotion in the 3D world !I am extending that thanks from my heart as well... Thanks to all whom wish to see Carrara become more recognized amidst the high demand 3D world of CG!

    I's also like to thank DUDU for bringing up this crazy freaking thread!
    Territan, I had to pick my jaw up off the floor. What excellent examples of how useful these formulas could be! You're right, we need a cookbook.... :)

    Agreed! I gotta say, however, that this tid bit (link only takes you up a bit on this same page! lol) goes a long way to show example of what can be done, if you actually take the time to dig through some of those simple links. I must say that I'm finding the translation to be less useful than I thought it would be, but... there it is ;)

    Territan, I mean... God... I mean... Territan... okay which of you is which?
    Alright...
    I really like your explanations that you provide as you work through your examples. So this brings about the bazillion dollar question:
    "When should we expect to see this Cook Book of yours to hit the shelves?"
    I'll buy it.
    This is really funny, too. Because I am, like many others, I'm sure, one of the variety that really never planned to figure out exactly what all we can or cannot do with formulas in Carrara. Now here I am at the edge of my seat. Some of the examples I've seen within the links of that French page (from this day forth, I shall always refer to that wondrous link as "That French Page! lol) are very close to something I'd love to be able to create in Carrara very quickly. Without it being quick, I'd just rather make an alpha map. Making and using alpha maps is quickly becoming a peeve of mine. I enjoy the Carrara trees and their leaves so much - with their complete lack of use of alphas.
    I am beginning to see where it's likely faster to just have a few extra polygons than it is to use alpha maps.

    So now that I've had a short perusal of "That French Page", I am certainly going to be using formulas in Carrara. Does this mean I'll look heavily into figuring out my own stuff the likes of what Territan (bless his heart) is doing? Maybe. I've never done poorly at math - and geometry was just, plain cool! Loved that class!
    The point was supposed to be that I wouldn't really need to. There are examples a plenty on that French page to keep me fulfilled for some time. It's not like I'm looking to replace box modeling with formulas.

Sign In or Register to comment.