MATLAB SIMULINK 3D ANIMATION 5 User Manual Page 23

  • Download
  • Add to my manuals
  • Print
  • Page
    / 43
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 22
21
Wheel (Shape) [VR Car in the Mountains]
Tree1 (Group) [VR Car in the Mountains]
Wood (Group) [VR Car in the Mountains]
Canal (Shape) [VR Car in the Mountains]
ElevApp (Appearance) [VR Car in the Mountains]
River (Shape) [VR Car in the Mountains]
Bridge (Shape) [VR Car in the Mountains]
Road (Shape) [VR Car in the Mountains]
Tunnel (Transform) [VR Car in the Mountains]
V našem virtuálním světe je celá řada pojmenovaných uzlů, my bychom rádi
animovali polohu auta uzlu Automobile. Tento uzel je typu Transform jeho
polohu tedy můžeme nastavit změnou hodnoty jeho pole translation.
(Počáteční polohu auta zjistíme například tak, že stiskneme F5 zobrazíme si
drátěný model virtuálního světa – auto se skrývá v tunelu nalevo.)
K polím tohoto uzlu můžeme přistupovat dvojím způsobem buď s použitím
tečkové notace, anebo tak, že získáme handle k jeho objektu vrnode a
použijeme metod tohoto objektu:
Tečková notace:
pos = wh.Automobile.translation
3.0000 0.2500 0
Vytvoření objektu vrnode:
nh = wh.Automobile;
pos = nh.translation
<nebo také>
pos = getfield(nh, ‘translation’)
3.0000 0.2500 0
Nyní nastavme novou polohu auta. Můžeme to udělat hned třemi způsoby:
nh.translation = [3 0.25 10];
wh.Automobile.translation = [3 0.25 10];
setfield(nh, ‘translation’, [3 0.25 10]);
Page view 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 42 43

Comments to this Manuals

No comments