Sunteți pe pagina 1din 7

Physical Constraints. What can you do with those? What good are they? Sounds technical.

I've been eager to try them out ever since I saw that 'rag-doll' demo. The things you can do
with it are just about endless. swinging sign outside your tavern! a morning star. "ust use
your imagination.
When I #inally got around to $laying with them! I noticed they've migrated #rom just $ython
scri$t to a nice $anel. I was wor%ing with the &ehicle Physics! ma%ing an o## road simulation!
when I thought I'd try ma%ing a sus$ended bridge using the Physical Constraints. #ter
$laying with it a bit! it wor%ed out very nice. 'ou get that nice bouncy e##ect. (i%e the
$layground! when you jum$ on one end o# the bridge! the other end bounces.
It's several di##erent cubes lin%ed together using $hysic constraints. ttached at each end to a
#i)ed $oint. (et's see how I did it.
I started by adding a cube. I scaled it
down so it resembles one $lan% o# the
bridge. This will be the #irst #i)ed $anel
that our bridge will hang #rom.
(et's add another $anel.
Press 'Sh#t-*' to du$licate
our $anel. +ove this new
$anel just to the le#t o# the
#irst one! leaving a small ga$
between them #or
movement.
(et's ma%e it stic%.
,nder the '-bject
+enu ./01'! under
'Constraints'! clic%
on 'dd Constraint'!
go u$ and select
'2igid 3ody "oint'.
With the constraint turned on! we want to select 45inge6 #or the
ty$e. lso! clic% on the 'Show Pivot' button. That will let us see
e)actly where the $ivot $oint will be. In the 'to-bject7' te)t #ield!
ty$e in the object name o# your #i)ed $anel. I le#t it at the de#ault
name when I created the cube! so #or my e)am$le! my objects
name it 'Cube'. When we $ressed 'Sh#t-*' to du$licated it!
3lender named our new object 'Cube.889'.
We're going to adjust its $osition so it's in
between the two bridge $anels. 5ere we can
see our $ivot $oint. $$arently! when we use
the '5inge' ty$e! the object will $ivot on the
'P:' a)is. So! in my e)am$le! I'll also need to
rotate the $ivot $oint so the P: a)is is $arallel
to the $anels.
Note: 3e#ore we start adjusting our
$ivot $oint! $ress 'CTRL A' to a$$ly
our scale and rotation. I# you don't do
this! the $ivot $oint will be will be
wor%ing o## o# some other ghost
$osition;rotation that our cube was at
be#ore.
5ere! I've rotate my $ivot $oint so my
P: a)is is $ointing in the right
direction. This will be the line that our
$anel swivels on.
(i%e the $in in the hinge o# a door.
5ere! I've used the Constraint
$anel to adjust the location o# my
$ivot $oint so it lies in between my
two $anels. Since my bridge will
#le) downwards! I've adjusted the
$ivot down slight towards the
bottom side o# my $anels.
5ere's a clear view o# where you
want your $ivot $oint to be. -ur
P: )is is lined u$ with our
$anels.
(et's give our $anels some weight and see
what ha$$ens. With our #irst moving $anel
selected! bring u$ the '(ogic ./<1' window.
Clic% 'ctor'! '*ynamic' and '2igid 3ody' to
turn our $anel into a movable object. Clic%
the '3ounds' button and select '3o)' to have
our $anel's $hysics abide by the basic bo)
sha$e. $$arently! the 2adius does not have
much o# an e##ect. I# you have some $roblem!
turn the 2adius way down. Turn the
*am$.ing1 u$ slightly so the bridge will come
to rest a#ter a short time.
I# you've set everything u$ correctly so #ar! you can
$ress 'P' to start the game engine and see how our
hinge is wor%ing so #ar. In my test! my swinging
$anel #lo$s down and sways in the bree=e just as I
wanted to.
(et's go on to >uic%ly add more $anels and attach
the bridge on the other side.
We can easily create another $anel with the
Constraint already set u$. "ust select your
swinging $anel and $ress 'S5/T-*6 to
du$licate our $anel. The only thing we'll
need to do is change the 'to-bject' value on
our new $anel. -ur second $anel was
named 'Cube.889' when we created it. ?nter
this name #or the 'to-bject' on our @
rd
object.
In my $hoto.. I have Cube.88A selected! it is
attached to Cube.889. Cube.889 is attached
to our #i)ed $anel! named Cube.
Continue to do this until you have about B
more $anels created. Cee$ changing the
name so each $anel is connected to the
one created be#ore. 'ou can $ress 'P' to
test your $rogress and ma%e sure each
$anel is connected.
*u$licate your $anel one more time. This
one we will ma%e into another #i)ed $anel to su$$ort our
bridge on the other side. 2emove the '2igid 3ody
Constraint' #or this $anel. lso! switch to (ogic +ode ./<1
and clic% the 'ctor' button to turn it o##. This will $revent
the $anel #rom moving when we start the game engine.
The last thing we need to do is add a second 2igid 3ody
Constraint to the last moving $anel. This time! we'll
connect it to our #i)ed $anel at the end o# our bridge.
dd a second 2igid 3ody Constraint. 2otate it and adjust
it's location so it is in between the last moving $anel and
our last #i)ed $anel.
Change the 'to-bject' name to the name o# our last #i)ed
$anel. In my case! it is Cube.880.
In this image! you can see this $anel is connected to the
moving $anel be#ore it! Cube.88D and the #i)ed $anel at the
end! Cube.880.
Pressing 'P' #or my e)am$le! my bridge wor%s great. I added an IC- s$here! just #or #un
directly above the bridge at one end. In (ogic +ode #or the s$here! clic% actor! dynamic and
rigid body. Press 'P' and watch what ha$$ens when it dro$s down to your bridge.
5ave #un.
Scott.
www.blender@dclub.com

S-ar putea să vă placă și