如何在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 ++;
}
}热门推荐
2 留学生祝福语简短
10 2026新年的简短祝福语
11 牛年大气简短的祝福语
12 升班祝福语简短10字
13 新年顾客简短祝福语大全
14 周一祝福语简短精辟
15 幼师离别祝福语老师简短
16 学校校长新年祝福语简短
17 幽默的新娘祝福语简短
18 朋友买新房祝福语简短