Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Cloth bug ? [Scale and Position]

Author
Message
UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 9th Sep 2006 17:56 Edited at: 10th Sep 2006 14:11
Hello,

I'm trying to create some clothes in a game but I found a strange behaviour. Indeed it's about scaling and then positionning a cloth object, it seems to be a problem.

PROBLEM : if you are scaling a cloth object (scale object), the position of the object (phy set cloth position) is also scaled. Don't place the cloth object at the origin point (0,0,0) to understand this problem.

EXAMPLE WITHOUT SCALING:
A cloth object is created and positionned (10,10,0). You can see in the code below that the cloth is correctly positionned.



EXAMPLE WITH SCALING
I'm now scaling my cloth object 10 times because it's too small in my level. The object must be positionned at the same position but it's wrong.
The object is scaled 10 times so its position is also multiplied by 10. Initial position (10,10,0) ==> (100,100,0). Take a look below :



EDIT : ATTACHING A CLOTH
There is a problem with positions and scaling so it's really difficult to attach a scaled cloth to another object. You can try to make an attached banner and then to scale it to see that it's not working.

Are you agree with this or is there something wrong ?

Coding is dangerous for health ...
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 07:35
actualy there is no change in position whatsoever. instaed of placing the spheres on the right see where they fall on the left...the placement of the cloth is on the left side much like an image starts at 0 on the left.

UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 10th Sep 2006 12:05
Yes of course, the origin point is on the left corner. But with no scaling, the left corner is at the position (10,10,0 : the first sphere on the left) and with scaling the left corner is at the position (100, 100, 0 : the second sphere on the right). That is the problem.

For example, in my game, when I wanted to position my cloth object, if there is no scaling, the position is (400,200,200) but if I scale 10 times my object, the position must be (40,20,20).

Coding is dangerous for health ...
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 18:08 Edited at: 10th Sep 2006 18:21
ok so why not scale the object by adjusting the parameters of the cloth?...whatever you multiply by one if you want an even scale you multiply the other 2


I placed both at 10,100 and that is exactly where they stayed

UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 10th Sep 2006 18:39
Yes, I already tried to change the dimensions of the cloth. But, in fact, the dimensions of the cloth are limited and the maximum is not enough. See below :

Reference (phy set cloth dimensions) :
"Beware that there is a limit to the number of vertices therefore, having too high a level of vertices will result in being unable to create the mesh"

This command changes the number of vertices used to construct the mesh and not really the size that's why I use 'scale object'.

Coding is dangerous for health ...
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 18:45 Edited at: 10th Sep 2006 18:49
right with the depth being an inverse function...there fore by multiplying all 3 values including depth you maintain the same number of vertices

I definately agree that the scale thing is a bug...i am just trying to help you work around it

UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 10th Sep 2006 18:57 Edited at: 10th Sep 2006 18:58
Thanks for your help really

If I use "phy set cloth dimensions 2, => 10 <=, 10, 0.2", the cloth is too small, I can change to "phy set cloth dimensions 2, => 13 <=, 10, 0.2" but not above because I get an error.

If you try, you'll see that there is not a big difference in the cloth size. In conclusion, we can't use this command to change the size. Scaling the object seems to be the solution but the positions are not correct.

Finally, I really think it's a bug and I can't find any alternative.

Coding is dangerous for health ...
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 19:08 Edited at: 10th Sep 2006 19:10
but like i said the cloth depth is an inverse function so if you increase it it will allow you to resize it that way...did you look at and test the code i posted? you will see what i mean.

there you are just increasing 1 value...you need to increase the depth too to allow fro growth

if you wanted a cloth to be 1000 units large for example then your depth would be 20

10 , 10 , 0.2
100 , 100, 2.0
1000,1000, 20

see what i mean...have not tested 1000 one but i know the 100 works because it is in the one i sent to you.

ok yes it did work

bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 19:24 Edited at: 10th Sep 2006 19:29
it looks like the maximum vertices you can have is 5999 for your cloth before making your cloth multiply the dimensions you want times eachother then divide it by 5999 this would give you the depth you want for the cloth.

see this code (already tested)


UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 10th Sep 2006 19:29 Edited at: 10th Sep 2006 19:31
Yes, sorry, I missed the 'inverse function' when I read your post. Your code works perfectly and it's what I want with no positioning problems.

My error was to only change the width and the height of the cloth but it must be a proportional change. That's why nothing was working.

Thanks for all your explanations and your patience

Edit : so in fact, scaling is interesting to create bigger clothes (with no limit of size and vertices problems, I mean), isn't it ?

Coding is dangerous for health ...
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 19:31
np glad i could help

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Sep 2006 00:59
Yes cloth is quite useless without a scaling function (or the make cloth from object command needs to be put in). I use the cloths from the 3D cloths and particles until then.

UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 11th Sep 2006 12:23
So, even if bosskeith gives a solution to avoid scaling, I think I need to post this problem in the bug board if you're agree with this ?

Coding is dangerous for health ...

Login to post a reply

Server time is: 2024-03-29 14:36:18
Your offset time is: 2024-03-29 14:36:18