DevOps研发效能
媒体矩阵
开源中国APP
授权协议 BSD-2-Clause
操作系统 Windows
软件类型 开源软件
开源组织
地区 不详
投 递 者 御坂弟弟
适用人群 未知
收录时间 2021-01-21

软件简介

ClayGL 是一个 WebGL 图形库,用于构建可伸缩的 Web3D 应用程序。

ClayGL 易于使用,可针对高质量图形进行配置。得益于模块化和 tree shaking,对于基本的3D应用程序,它可以缩小到22k(压缩)。

示例

创建旋转立方体示例

<!DOCTYPE html>
<html lang="en">
<head>
  <script src="lib/claygl.js"></script>
</head>
<body>
  <canvas id="main"></canvas>
  <script>
    clay.application.create('#main', {

      width: window.innerWidth,
      height: window.innerHeight,

      init(app) {
        // Create camera
        this._camera = app.createCamera([0, 2, 5], [0, 0, 0]);

        // Create a RED cube
        this._cube = app.createCube({
            color: '#f00'
        });

        // Create light
        this._mainLight = app.createDirectionalLight([-1, -1, -1]);
      },
      loop(app) {
        this._cube.rotation.rotateY(app.frameTime / 1000);
      }
    });
  </script>
</body>
</html>

 

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
82 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部