DevOps研发效能
媒体矩阵
开源中国APP
授权协议 MIT
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2019-05-30

软件简介

zdog 是一个圆形、扁平、设计师友好的伪3D引擎。

Zdog 灵感来自 Dogz ,Zdog 使用相同的原理。 它使用<canvas>或<svg>中的2D绘图API渲染所有形状。 球体实际上是点。 Toruses实际上是圆圈。 胶囊实际上是粗线。 这是一个简单而有效的技巧。

Zdog在美国用语中被称为“Zee-dog”,在英国被称为“Zed-dog”。

Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog Made with Zdog

示例代码

let isSpinning = true;
let illo = new Zdog.Illustration({
element: '.zdog-canvas',
zoom: 4,
dragRotate: true,
// stop spinning when drag starts
onDragStart: function() {
isSpinning = false;
},
});
// circle
new Zdog.Ellipse({
addTo: illo,
diameter: 20,
translate: { z: 10 },
stroke: 5,
color: '#636',
});
// square
new Zdog.Rect({
addTo: illo,
width: 20,
height: 20,
translate: { z: -10 },
stroke: 3,
color: '#E62',
fill: true,
});
function animate() {
illo.rotate.y += isSpinning ? 0.03 : 0;
illo.updateRenderGraph();
requestAnimationFrame( animate );
}
animate();

 

展开阅读全文

代码

的 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 评论
8 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部