如何在HTML5中绘制3D球面?
要创建3D球体,请使用HTML5画布。您可以在代码中使用以下功能:
function display(r) {
this.point = new Array();
this.color = "blue)"
this.r = (typeof(r) == "undefined") ? 20.0 : r;
this.r = (typeof(r) != "number") ? 20.0 : r;
this.vertexes = 0;
for(alpha = 0; alpha <= 6.28; alpha += 0.17) {
p = this.point[this. vertexes] = new Point3D();
p.x = Math.cos(alpha) * this.r;
p.y = 0;
p.z = Math.sin(alpha) * this.r;
this.vertexes ++;
}
}热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短