如何在Doom3场景中运行多个MD5骨骼动画序列

1. 准备工作:

  • 首先生成一个名为index.html文件,作为Application运行的宿主,具体源码如下所示:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
        <canvas id="webgl" width="800" height="600" style="background: lightgray;" />
    </body>
    <script src="./dist/bundle.js">
    </script>
</html>
  • 然后生成一个例如名为maint.ts的入口文件,具体源码如下所示:

import { Doom3SceneWithMD5SkeletionApplication } from "./demo/Doom3SceneWithMD5Sketion";
// 获取用于获得webgl上下文对象的HTMLCanvasElement元素
let canvas: HTMLCanvasElement | null = document.getElementById( 'webgl' ) as HTMLCanvasElement;
// 创建Doom3SceneWithMD5Skeletion对象
let app: Doom3SceneWithMD5SkeletionApplication = new Doom3SceneWithMD5SkeletionApplication( canvas );
// 调用run方法进入不停刷新和绘制流程
app.run();
随风而行之青衫磊落险峰行(www.buleifeng.top) all right reserved,powered by Gitbook本文件修订时间: 2019-10-18 15:22:32

results matching ""

    No results matching ""