Fri, Jan 3, 10:15 PM CST

Renderosity Forums / Carrara



Welcome to the Carrara Forum

Forum Coordinators: Kalypso

Carrara F.A.Q (Last Updated: 2024 Dec 29 10:47 pm)

 

Visit the Carrara Gallery here.

Carrara Free Stuff here.

 
Visit the Renderosity MarketPlace - Your source for digital art content!
 

 



Subject: 15 Minute Challenge: Beginning Formula Objects


twillis ( ) posted Wed, 24 April 2002 at 12:30 PM · edited Sun, 29 December 2024 at 5:01 PM

Hey, I've been having fun messing with formulas, and I think I've come up with a challenge to encourage those of you who haven't messed with formulas to get your feet wet. From the Assembly room, Insert a Formula. Double click on it to go to the modeling. Erase the formula that's there, and replace it with: x=10u; y=10v; z=1; Click on the Parse button. The result will be a 10x10 plane floating 1 unit above the z-axis. Here's the challenge: Change the z line to make the resulting shape more interesting. Hint: z can be a function of u and/or v, and, since they're already defined, y and/or x.


brenthomer ( ) posted Wed, 24 April 2002 at 2:40 PM

I dont know what the heck you are talking about... You know what would be nice maybe? A complete list of numeric commands you can use..is that even in the manual? I dont remember seeing it. -brent


twillis ( ) posted Wed, 24 April 2002 at 2:59 PM

It's in Chapter 20 of my version of the manual. I'll try to print a screen shot of the formula editor when I get home today, so that what the heck I'm talking about is a bit clearer. Meanwhile, here's one to try: z=x*y;


nyar1ath0tep ( ) posted Wed, 24 April 2002 at 3:55 PM

file_5694.jpg

As a beginner, I can appreciate a challenge like this. So here's the formula: x=10*(u-.5); y=10*(v-.5); z=10-(x*x+y*y)/4; Apparently u and v vary from 0 to 1 (like in UVMapping coordinates), so I had to keep it at u-.5 and v-.5 to get a full surface of revolution. It looks like x and y limit the boundaries, and z is the real equation for the surface.


twillis ( ) posted Wed, 24 April 2002 at 5:53 PM

file_5695.jpg

Very cool. The "u-0.5" trick is a handy one, also multiplying that by PI, or 2PI can be useful for trigometric functions. It does appear you can mix and match a bit; u doesn't have to be the variable for x, and so on. Anyway, here is a quick screen shot of the starting (boring) formula:


twillis ( ) posted Wed, 24 April 2002 at 5:56 PM

file_5697.jpg

Slightly more intersting. Very slightly.


twillis ( ) posted Wed, 24 April 2002 at 5:59 PM

file_5698.jpg

OK, now we are getting somewhere. Notice the "p1" variable in the last line. That's so I can animate this sucker.


twillis ( ) posted Wed, 24 April 2002 at 6:03 PM

file_5699.jpg

Heck, while were at it, how about a formula texture. Formula textures are similar to formula objects, only instead of using u and v to generate x, y and z values, you use u, v, x, y and z to generate red green blue values. floor(x) is a handy function, basically it return the next lowest interger. For example, if x=4.317, floor(x) = 4, and x-floor(x)= 0.317. I use this to keep rgb values between 0 and 1, and it's an easy way to make stripes. ceil(x) works in a similar way.


twillis ( ) posted Wed, 24 April 2002 at 6:16 PM

file_5701.jpg

Whee! And this animation only has two keyframes; p1=-1 in the first frame, and p1=1 in the last. The formula does everything else.


keithw ( ) posted Wed, 24 April 2002 at 7:39 PM

file_5702.jpg

Hey Terri, I tried to place the black and white checkerboard texture on your animated formula. This is what I got


nivek_ ( ) posted Wed, 24 April 2002 at 8:37 PM

I don't know what I'm doing with this formula thing but, when I type stuff in it RDS crashes. The formula is: x=cos(4PIv)cos(72PIp1u); y=1; z=1; Is this formula impossible?


nyar1ath0tep ( ) posted Thu, 25 April 2002 at 12:07 AM

I think x has to be a function of u alone and y has to be a function of v alone, so I think x=cos(4PIv)cos(72PIp1u) would cause a circular reference that would crash the software.


Kixum ( ) posted Thu, 25 April 2002 at 2:37 AM

file_5703.jpg

Here's Mine

-Kix


twillis ( ) posted Thu, 25 April 2002 at 8:15 AM

Very cool, Kixum. What was the formula? That shape would make a fun alien or monster, flying toward you to absorb your soul! Well, if that's your idea of fun, anyhow. nyar1ath0tep, I'm not sure that x has to use u, and that y has to use v (I guess I need to test this more). Plus, I'm not sure how RDS differs. nivek, I think that your x definition might be ok, and that the problem is have both y and z equal to a constant; the result would be a line segment at y=1 and z=1, with the width determined by your x formula, which might not be visible, or might confuse RDS. Try making either y or z a function of u or v, like y=10u, and see if that helps. keithw, I like the "checkboard" you got. Would make for a challenging game, don't you think? I'm not sure, but I think you could make a checker board that "stuck" to the shape, by defining the regions in terms of u and v. You might try a simple 4-square, with something like: a = floor(u2); (result should be 0 or 1) b = floor(v2); (result should be 0 or 1) blue = ab; (result should be 0 or 1) I think the result would be a 4-square checker board, but you guys might want to check my math. Um, might have to add some sort of fudge factor for u and v = 1, but I'll test it when I get home today.


twillis ( ) posted Thu, 25 April 2002 at 5:14 PM

file_5704.jpg

OK, nivek, I've been playing with your formula. In Carrara, you can mix and match u, v, x, y, z. Not sure about RDS. Here's one adaptation of your formula.


twillis ( ) posted Thu, 25 April 2002 at 5:17 PM

file_5705.jpg

But perhaps this was what you had in mind.


twillis ( ) posted Thu, 25 April 2002 at 5:27 PM

file_5706.jpg

Also, it turned out that the checkerboard formula was a bit more complicated than I thought. This should work, and let you change the values of h and i to control the how many squares across and down you have. Nivek's formula is groovy, so I used it for this example.


DotPainter123 ( ) posted Thu, 25 April 2002 at 6:35 PM

I tried some parametric functions from by calc book and still yechhh! I need to play with this some more!


keithw ( ) posted Thu, 25 April 2002 at 7:51 PM

Thanks again Terri! It works perfectly. The checkerboard now moves with the animation. I had a little trouble with the formula until I figured out that || is not two lowercase l's and that both h and i should be equal. Keith


nivek_ ( ) posted Thu, 25 April 2002 at 8:15 PM

Thanks for the help twillis. I typed in your ammended formula and ended up with a small flat shape. But it didn't crash. Is there a difference between RDS and C formula?


Kixum ( ) posted Thu, 25 April 2002 at 11:11 PM

file_5707.jpg

My formula.

-Kix


keithw ( ) posted Fri, 26 April 2002 at 7:00 AM

file_5708.jpg

Here is Terri's animateable checkerboard texture formula applied to an animated formula object. No more changing patterns! Here's the formula I used for the animated object. x=10*u; y=10*v; z=cos(2*PI*p2*(4*u))*cos(2*PI*p1*(4*v));


Nicholas86 ( ) posted Sat, 01 June 2002 at 6:26 PM

I will be copying the information from here to my website for a resource for others. All users names will be sited. If you have a problem with me using your formula, please email me and we could work something out. Thanks you. I hope for more assistance from those of you who have a better understanding of formula


twillis ( ) posted Sat, 01 June 2002 at 9:26 PM

You're welcome to use anything I have posted here.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.