Virtools 高级教程—Following Camera跟随相机 - Virtools
Following Camera
Instruction:
此范例可以和「Pan Camera」作一个比较,这里所表现出来的效果是Camera-New Camera的镜头永远对着人物-Eva的后方,且Camera永远与Eva保持一定的距离;而Camera会随着Eva转动而跟着移动,也会因Eva移动而跟着移动。
Building Blocks:
(a) Character Controller-Characters/Movement/Character Controller
(b) Character Keep On Floor-Characters/Constraint/Character Keep On Floor
(c) Keyboard Controller-Controllers/Keyboard/Keyboard Controller
(d) Object Slider-Collisions/3D Entity/Object Slider
(e) Set As Active Camera-Cameras/Montage/Set As Active Camera
(f) Set Position-3D Transformations/Basic/Set Position
(g) Look At-3D Transformations/Constraint/Look At
Keep At Constant Distance-3D Transformations/Constraint/Keep At Constant Distance
制作构想:
首先必须利用Building Blocks-Character Controller、Keyboard Controller设定键盘控制Eva的动作;再利用Building Blocks-Character Keep On Floor、Object Slider等设定Eva与地面接触和碰撞等属性。
此外,可以增加一个3D Frame-New 3D Frame,再配合Building Blocks-Set Position、Look At、Keep At Constant Distance的方式,可以表现出Camera迟缓移动的效果(如图标)。
制作步骤:
(a) Eva
Character Controller:设定Eva的Animations。
首先从Virtools Resources/Characters/Animations/Skin Character Animation/Eva里点选Wait.cmo、Walk.cmo、Walk Bckwd.cmo以及Run.cmo并拖曳至Eva,再设定Stand Animation、Walk Animation、Backward Walk Animation以及Run Animation(如图标)。
Keyboard Controller:设定Eva可以经由键盘来操控动作,内定值为Wait-None、Walk-Key 8、Turn Left-Key 4、Turn Right-Key 6、Backward Walk-Key 2、Run-Key Insert。
Character Keep On Floor:于Level Manager/Default Level/Global/3D Objects/Plane/Add Attribute/Floor Manager/Floor增加保持与地面接触的属性,再于Building Blocks-Character Keep On Floor作循环即可(如图标)。
Object Slider:设定Eva的碰撞属性Group Obstacles Eva;Radius-碰撞半径(如图标)。
(b) New Camera
(c) New Camera
Set Position:设定目标物Camera Referential(3D Entity)-New 3D Frame;设定目标物相对于基准物的位置Position(X,Y,Z)-(0,2,10);设定参考物Referential-Eva(如图标) ;勾选Hierarchy-表示其行为也应用在Child上。
Look At:Position表示Cam