[Tutorial] Soft Body cloth in BGE

Moderators: Yodaman921, Gabriel

[Tutorial] Soft Body cloth in BGE

Postby hydra_skillz » Wed Feb 11, 2009 7:22 pm

This is a tutorial on how to make low poly cloth for the game engine (it blows in the 'wind' too!).

Go into front view, and scale the default cube on the x axis so it looks like a beam (I used 10).
sbc1.jpg
sbc1.jpg (108.03 KiB) Viewed 9752 times
Now add a plane, rotate it 90 degrees on the x axis, scale it up some (I used 7), and move it below the beam, but still touching it.
sbc2.jpg
sbc2.jpg (153.91 KiB) Viewed 9752 times
Go to edit mode and press w → subdivide multi and use 2 or 3. Press ctrl + a and apply scale and rotation to ObData (This is VERY important, if you don't do this, you cloth will be the same size it was when you added the plane). Now go back to object mode, then to the object buttons (F7) and add constraint rigid body joint. Switch Ball to Hinge, set toObject to Cube and click ShowPivot. Set pivot x to -7 and pivot y to 7. Add another rigid body joint with the same settings, except have pivot x equal 7.
sbc3.jpg
sbc3.jpg (165.83 KiB) Viewed 9745 times
Now go to the logic panel (F4) and use these settings.
sbc4.jpg
sbc4.jpg (36.79 KiB) Viewed 9741 times
That's all for the cloth. To make it look like its blowing add a delay sensor set to 30,30,REP (a random sensor can be added too) and a motion actuator with y force set to 5.
sbc5.jpg
sbc5.jpg (89.66 KiB) Viewed 9740 times
You now have a hanging cloth that blows in the wind! The cloth will react to other objects too, like your player, bullets, etc.
GE API <- reference for game engine scripting
User avatar
hydra_skillz

Premium Member
 
Posts: 1321
Joined: Mon Dec 15, 2008 5:22 pm
Location: North Carolina

Re: [Tutorial] Soft Body cloth in BGE

Postby llamalizard » Wed Feb 11, 2009 10:53 pm

you are really very good at this...time to make a ragdoll with a cloth door behind it. just as a test.
Argh, I be back!
User avatar
llamalizard

Premium Member
 
Posts: 1302
Joined: Thu Aug 28, 2008 5:04 am

Re: [Tutorial] Soft Body cloth in BGE

Postby hydra_skillz » Wed Feb 11, 2009 11:02 pm

Thanks, I just hope I am good at explaining it too :roll: .
GE API <- reference for game engine scripting
User avatar
hydra_skillz

Premium Member
 
Posts: 1321
Joined: Mon Dec 15, 2008 5:22 pm
Location: North Carolina

Re: [Tutorial] Soft Body cloth in BGE

Postby llamalizard » Thu Feb 12, 2009 1:14 am

hydra_skillz wrote:Thanks, I just hope I am good at explaining it too :roll: .



Don't worry too much about that. your tutorials are easy to understand.

speaking of which...I might make a tutorial for UV eventually. that is, more then just a cube. maybe starting with a UV sphere
Argh, I be back!
User avatar
llamalizard

Premium Member
 
Posts: 1302
Joined: Thu Aug 28, 2008 5:04 am

Re: [Tutorial] Soft Body cloth in BGE

Postby loist » Thu Feb 12, 2009 9:41 am

Thx for the tutorial ;)
...creation is the way to create something...

sorry for my bad speech, i'm lithuanian
Image
Image
User avatar
loist

Member
 
Posts: 461
Joined: Thu Apr 03, 2008 11:16 am
Location: Kaunas - Šiauliai, Lithuania

Re: [Tutorial] Soft Body cloth in BGE

Postby llamalizard » Fri Feb 13, 2009 1:13 am

A small problem...my cloth is kinda...well, now blowy. it just falls a bit and nudges back and forward. are objects meant to fly through?
Argh, I be back!
User avatar
llamalizard

Premium Member
 
Posts: 1302
Joined: Thu Aug 28, 2008 5:04 am

Re: [Tutorial] Soft Body cloth in BGE

Postby hydra_skillz » Fri Feb 13, 2009 10:21 am

The cloth is suppose to blow just a little bit. You can increase the force to make it more. If you use locational motion, objects may pass through it.
GE API <- reference for game engine scripting
User avatar
hydra_skillz

Premium Member
 
Posts: 1321
Joined: Mon Dec 15, 2008 5:22 pm
Location: North Carolina

Re: [Tutorial] Soft Body cloth in BGE

Postby kopiko » Tue Sep 08, 2009 5:07 am

I will try from a computer with an easier to understand firewall

financement automobile | simulation credit | comparatif taux pret auto | calcul voiture une simulation crédit auto, le souscripteur doit remplir des renseignements financement automobile | simulation credit | comparatif taux pret auto | calcul voiture
kopiko

Member
 
Posts: 1
Joined: Tue Sep 08, 2009 5:05 am

Return to User Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest