I bought the cloth and particle effects plugin the other day, and I've been screwing around with it ever since.
But I seem to be having issues with positioning cloth objects. I've tried to find other posts in relation to my problem, but have been unsuccessful.
With these bits of code coming up, I am trying to create a hanging ceiling tapestry effect. I've created a cloth, 6 anchor point objects and positioned them up high, so to be above the camera. I try to center the cloth object inbetween the objects, without luck.
All of my cloth positioning attempts with "postion object" have been done with the idea that the positioning point of the cloth is in the center of it. So when I position the cloth, I only put it half-way inbetween the anchor points.
Here is the first try:
`creating anchor objects for cloth
for index = 1 to 6 step 1
make object cube index,1
next
position object 1,0,10,0
position object 2,20,10,0
position object 3,0,10,50
position object 4,20,10,50
position object 5,0,10,100
position object 6,20,10,100
make cloth 10
generate rectangular cloth 10,20,100,2,10,1
position object 10,10,10,50
fix cloth point to object 10,0,1
fix cloth point to object 10,2,2
fix cloth point to object 10,15,3
fix cloth point to object 10,17,4
fix cloth point to object 10,30,5
fix cloth point to object 10,32,6
position camera 0,5,0
make gravity effector 11
bind effector to object 11,10
do
update physics
control camera using arrowkeys 0,1,1
loop
And here is what happens:
Then I tried freeing all the points of the cloth before positioning it(I thought that they were defaultly fixed in space):
`creating anchor objects for cloth
for index = 1 to 6 step 1
make object cube index,1
next
position object 1,0,10,0
position object 2,20,10,0
position object 3,0,10,50
position object 4,20,10,50
position object 5,0,10,100
position object 6,20,10,100
make cloth 10
generate rectangular cloth 10,20,100,2,10,1
free all cloth points 10
position object 10,10,10,50
fix cloth point to object 10,0,1
fix cloth point to object 10,2,2
fix cloth point to object 10,15,3
fix cloth point to object 10,17,4
fix cloth point to object 10,30,5
fix cloth point to object 10,32,6
position camera 0,5,0
make gravity effector 11
bind effector to object 11,10
do
update physics
control camera using arrowkeys 0,1,1
loop
Nothing changed that I could see. The cloth was still in the same spot.
Then I tried repositioning the anchor points
after fixing the cloth points to them:
`creating anchor objects for cloth
for index = 1 to 6 step 1
make object cube index,1
next
make cloth 10
generate rectangular cloth 10,20,100,2,10,1
free all cloth points 10
position object 10,10,10,50
fix cloth point to object 10,0,1
fix cloth point to object 10,2,2
fix cloth point to object 10,15,3
fix cloth point to object 10,17,4
fix cloth point to object 10,30,5
fix cloth point to object 10,32,6
position object 1,0,10,0
position object 2,20,10,0
position object 3,0,10,50
position object 4,20,10,50
position object 5,0,10,100
position object 6,20,10,100
position camera 0,5,0
make gravity effector 11
bind effector to object 11,10
do
update physics
control camera using arrowkeys 0,1,1
loop
The cloth freaks out for a second, and then settles into this state:
I don't know if this is my fault, or a bug, or what. The question is, how do I position a cloth object?
-
Ignore the avatar...