- Learning Game AI Programming with Lua
- David Young
- 217字
- 2021-08-05 17:02:16
Skeletons and meshes
First, we need to cover some basics on how animations are represented and used by the sandbox.
Mesh skeletons
So far, we've learned how to create mesh representations within the sandbox. We're now going to deal with an additional asset called a skeleton. Ogre, which is the underlying renderer for the sandbox, stores the skeleton and animations within a single .skeleton
file. Any animated Ogre mesh within the sandbox references its animations from the media/animations
folder, and in the case of our soldier, animations are located at media/animations/futuristic_soldier/futuristic_soldier.skeleton
.
Loading an animated mesh
Loading an animated mesh is exactly the same as loading a normal mesh within the sandbox. Simply create an animated mesh with the Core.CreateMesh
function:
Sandbox.lua
:
function Sandbox_Initialize(sandbox) local soldier = Core.CreateMesh( sandbox, "models/futuristic_soldier/" .. "futuristic_soldier_dark_anim.mesh");
Showing a skeleton
By default, there is nothing visually different when loading a standard mesh or an animated mesh unless we render the skeleton. The sandbox provides an easy debug representation of the skeleton with a SetDisplaySkeleton
call:
Sandbox.lua
:
function Sandbox_Initialize(sandbox) ... Animation.SetDisplaySkeleton(soldier, true);
The following screenshot shows you the soldier mesh with the debug skeleton information drawn. By default, animated meshes will show up typically in a T-pose when no animations are being applied to the skeleton.

Animated mesh showing you the debug skeletal information
- 計算機組成原理與接口技術:基于MIPS架構實驗教程(第2版)
- 數據存儲架構與技術
- 數據挖掘原理與實踐
- 計算機信息技術基礎實驗與習題
- Python廣告數據挖掘與分析實戰
- PySpark大數據分析與應用
- Libgdx Cross/platform Game Development Cookbook
- Learning Proxmox VE
- 數據挖掘原理與SPSS Clementine應用寶典
- Instant Autodesk AutoCAD 2014 Customization with .NET
- 跨領域信息交換方法與技術(第二版)
- 大數據數學基礎(Python語言描述)
- 數據庫原理與設計實驗教程(MySQL版)
- MySQL數據庫實用教程
- 數據分析思維:產品經理的成長筆記