View Full Version : ClothFX Insanity

11-23-2008, 12:26 PM
Okay, I'll try to maintain my composure...

I've used LW since the Amiga days. And every time I've tried to do something in ClothFX my brain explodes. Literally.


Let's say you have a rectangular mesh (y'know, like a bed sheet or something...) you want to fall, under normal, everyday gravity, and collide with a simple box object. Easy, right?

Well, to set it up in LW you select the sheet object, and then go into its Object Properties to make it all clothy and stuff. Under the Dynamics tab you select ClothFX to apply a cloth property to the sheet. Makes sense, right?

So then you need to figure how to make it fall under gravity. Well, you're about to get the heck out of the sheet's Object Properties panel to apply gravity, because, as anyone knows, that's not a property of the sheet, it's a property of, like, the EARTH. But as you click around the other tabs in the sheet's Object Properties, you see under the "Etc" tab some fields where you can add the -9.8 m/sec ^2 stuff for gravity.

HUH ?? In my world, sheets have virtually zero gravity. Stuff has to be, like, really BIG to have any noticeable gravity. So why would any rational person add a section in the Object Properties tab to enter gravity? At that point my brain starts vibrating.

Then you go back out to the scene, and add gravity where it should be added, under Add/Dynamic Object/Gravity. Well, "should be" is a relative term. In Lightwave land, that is... In the real world, however, gravity is, like, always down, and always at -9.8 m/sec ^2. I know this...I'm an engineer. So instead of a General Preferences where you can set gravity, since 99.9999% of the time you use it in the "normal" way (yeah, I know you can do cool stuff with wierd gravity settings, but that's almost always the exception...), you have to go in each and every time to enter the value in the Y axis.


Anyway, so you add a Gravity effector, and, of course, its default size is 1 meter cubed, with a value of -1.0 m/sec^2. Makes sense, right? 'Cuz as we all know, real gravity only affects an area of 1 meter, not the entire surface of the earth. And it's not really -9.8 like we were all taught in school, it's really -1, right?? GEESH !!! WHO WRITES THIS STUFF ???

So then you have to figure out how to make the cloth collide with the simple box. Now here's where it gets wierd...

Either you'd think you could tell the cloth to collide with everything, or tell the box to collide with the cloth...so you toss a coin, and you go back into the cloth properties, click on "ClothFX", and see a "Collision" tab, and you select the surface name of the sheet for collision detection.

COOL !! Good to go, right??

NO !!! You hit IKB Calculate, and ZOOM, everything falls out of view. And you realize somebody actually coded this to, by default, have gravity affect the whole world. Reasonable, but certainly not practical. So then you try to figure how to keep gravity from affecting your box.

At this point my brain starts shooting sparks all over the room...

So then you, calmly, go to the gravity effector to see if you can de-select the box object from being affected. Hmm, can't find anything there...maybe that "Group" thing, but who knows what that's all about...

So then you realize that maybe the gravity setting in the sheet's Object Properties was just another of LW's typical kludges. Instead of coding it rationally, they "fixed" all this by implementing a totally irrational and illogical bandaid.

So you kill the scene's gravity effector, and set up gravity in the sheet's Object Properties.

Ahh, FINALLY, we've got it figured out....

11-23-2008, 01:23 PM
Part II:

Okay, as we all know, we DIDN'T have it all figured out. This is LW we're talking about...

Since gravity applied to the sheet also caused everything to fall under gravity, you toss the coin again and decide to also make the simple box as a collision object. And since you're a real smart guy, in both objects' collision properties you give them a 5mm collision distance to make sure the objects didn't pass inside each other. Pretty sharp, huh?

Uh, not so fast. You run the simulation, and YEAH !! the box stays still and the cloth falls onto it. But you immediately notice that the cloth passes inside the box surface.

Hmm...brain starting to fry...

Okay, so you start to remember hearing something about ClothFX and triangular polygons...not sure what, but you triple the sheet just in case and run it again.

That didn't do it...

Okay, maybe you need to divide the box surfaces (AND triple them) to get it to work.

Ahh, NOW we've got it !!! Look, it's working !!! See the image below, for some real ClothFX goodness !!!

11-23-2008, 01:31 PM
a bit tragic, but funny! Gave me a big smile!

11-23-2008, 01:31 PM
Hi there.

Cool to see another one from the good ol' amiga days.

But unlike you i dont think that cloth fx is such a pain. At least not with something as simple as a box and a sheet.
I've learned that since we are in the world of 3d, we make things believable with a software that has sertain tools in it. The tools are there for us to use and to make others beleave that its "real".
So even if you apply values that are true for the real world, doesnt have to make the simulation believable. Its art, not sience. We know how the tool works and apply them in a way that makes it look natural.

Now, I agree that its strange that the default values are not set as we are used to see them. But hey, havent Lightwave been used for a lot af SiFi movies and series. Maby thats the reason for the low gravity set by default.

Work with the software, not against it.

I adore the simplicety of things in lightwave, and find it to be the easiest software to work in unless there are some... Hmmm.. Nope, I always prefer lightwave. Ive been working and tutoring in booth XSI and Maya, but i still prefer Lightwave any day of the week. Not that all problems can be solved i LW, but it still has the fastest worklow for me. (notice that I said for me.)

11-23-2008, 01:56 PM
I just made youre example.. I can post i gl preview for you to load in layout. Its about 5 Mb.
It took less then five minutes.


11-23-2008, 02:05 PM
Thanks Salv8or. But here's my issue...

For those who have spent many years mastering the cryptic irrationality that is LW, the craziness becomes normal. People get so used to jumping thru hoops and mastering workarounds that it becomes standard practice. And they begin to expect it. And they don't complain, they put up with it. And LW keeps tacking on kludged code, such as ClothFX, and it actually seems normal to folks.

I'm sure there's a way to do what I'm trying to do, but my point is that a rational person, with many years of experience with LW, goes thru a completely rational series of steps to try and accomplish something simple, and they end up at a deadend. That tells me that the code is VERY poorly designed.

11-23-2008, 02:06 PM

11-23-2008, 02:09 PM
I also think the 'real world' analogy is flawed. Since when does LW claim to focus on real world situations? It is the lowest end of graphics progams that make such assumptions for you.

In all programs, you will find that the minimum number of objects are affected, not the whole environment. Why waste the computing time? Objects weigh nothing in 3D, so often playing with the gravity of different objects can indeed produce more 'realistic' (ie. convincing, not necessarily mathematically correct) results, faking friction, wind, etc etc.

In any case -

Have you seen the William Vaughan tute on distorting a mesh using cloth FX (ftp://ftp.newtek.com/multimedia/movies/w3dw/mic.mov)? I think that should mimmick what you want ..

11-23-2008, 02:17 PM
I also think the 'real world' analogy is flawed. Since when does LW claim to focus on real world situations?

That's my point...it doesn't.

But its users do. I'm gonna guess that 90% of uses of LW ClothFX deal with real life scenarios. Maybe 80%. Pick a number.

But a really well designed application would allow users to decide if they want it to assume real life or not. LW assumes you're NOT dealing with real life.

That's bad. Very bad.

And by the way, whenever someone complains about the major shortcomings of LW, people respond with "hey, there's 136 hours of videos you can watch". My point is you shouldn't NEED 136 hours of videos. A well designed application, designed for users, should be mostly intuitive, and the rest is a small amount of training.

11-23-2008, 03:07 PM
If its the values that are set from the begining that bugs you, than thats tough. But make a scene then with a grav. eff. that has -9.2 and save that one. Every time you are going to wotk with simulations, load the scene.

In maya and XSI the default value is -9.2, but ive found that i still fidle with the values to get the result that i wat.
Cos how ever you look at it, a simulation in 3d cant be compared to the real world, since we are dealing with polygons and vertecies and the real world does not.

Im not to found of ClothFX either, I think its to slow to be used in any bigger and advanced simulations, and all i tend to do with it is using a low poly object to simulate around cartoony stilized characters and use hte meta plugin for deforming the accual cloth. It gives for some nice cartoony animation, but not realworld sims.

Of to see madagaskar2.

We all love lightwave anyways, thats why we nag, right.


11-23-2008, 03:19 PM
The thing is, most of the other 3d packages do the exact same thing. The key word is simulation. For something like cloth, you can't simulate the exact physics that take place in a real piece of cloth, it would be too computationally complex, so they use mathematical approximations. Likewise, you can't build your sheet out of cotton fibres, that would be computationally complex. So it's all fakes and simplifications. One of the simplifications LW allows you is to add gravity in the clothfx plugin. You can add your own separate gravity object, which is what other packages do, but if you're just doing something like a sheet falling, having it in clothfx allows you to alter gravity without faffing around with a different object.
Also, a computer can only work with what's there, so for collision, you need reasonably dense meshes for accurate collision, but not so dense as to push calculation times through the roof, as you have found. It's all a balancing act, one that you have to learn to become a dynamics expert, like modellers have to learn modelling, and cinematographers have to learn lighting. It's not an easy area.

11-23-2008, 03:33 PM
For something like poser, the cloth is really kind of for a very specific purpose, for clothes on people. That means you can limit it in ways which make sense for clothes on people, and the clothes have been built in a very clothes for people kind of way. With Clothfx, it can be used for much more than that, which is why its settings are different. You can use it with boxes, spheres, cloth, any arbitrary shape. You can have it collide with any number of objects, so to let LW know which objects you want to have it collide with, you have to add collision to those objects, rather than have LW have to calculate it for the entire scene, which is what you would have to have.

11-23-2008, 06:06 PM
Dodgy, I hear ya...

But there is no reason, whatsoever, that ClothFX can't be designed so that the PROCESS of applying dynamics is more rational, intuitive, and user friendly. I realize it's all a simplification, and we're not modelling the real world. But that's not my point.

I'm saying that there is no reason ClothFX can't be designed with default preferences of, say, gravity settings of (choose one):

1. Always assume the scene is operating in gravity of -9.8 m/sec^2 in the -Y direction as default (user changeable in the actual simulation settings), or
2. Assume nothing, and operate like it does now

Easy, right? And how 'bout these settings:

1. Gravity only affects ClothFX objects? (yes or no; user changeable in the simulation settings)
2. ClothFX objects collide with which scene objects? (select all that apply)

A simple workflow like that would make it intuitive. That's all I'm talking about. It has nothing to do with whether we're modelling real life physics or not. I'm just talking about simple, rational workflow. And these are off the top of my head, so don't ding me because they're not perfect. But you get the idea...

And by the way, I just remembered a setting in Poser that allows you to select whether the collision calculation is made between the vertices on one object and the polygons on the other or vice versa. Very cool, because it allows you to (I think) use mesh with low poly count to collide with hi poly meshes. I think that might help the cloth vs. box simulation I was talking about. I'll try it...

11-23-2008, 06:30 PM
Okay, I just ran it in Poser. Simple and easy, but NOT because it constrains you, but because the workflow is rational.

You pick what you want to "clothify", what in the scene you want it to collide with, whether you want the cloth to collide with itself, and whether you want to have it calculate the object vertex colliding with the cloth polygon, or polygon with polygon, or neither.

Boom. You're done.

I selected the "vertex against polygon" and "polygon against polygon" options, and all the problems with surfaces passing under surfaces went away.

Very easy and simple, only because it's laid out in an intelligent manner.

11-23-2008, 06:38 PM
And by the way, I was not using prepackaged clothing objects. I built a simple cube in LW, and a simple mesh sheet, exported both as .obj, and imported into Poser to do the simulation.

I think that's one of the misconceptions about Poser. It is NOT just for premade content. It has a cloth engine that works one stuff just like ClothFX. Only smarter. :)