如何在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 ++;
}
}热门推荐
5 短祝福语简短暖心
10 结婚祝福语粤语大全简短
11 晚上祝福语女生文案简短
12 法语妈妈生日祝福语简短
13 药厂开工祝福语大全简短
14 蛋糕节日祝福语简短英文
15 跨年的生日祝福语简短
16 文案祝福语英文短句简短
17 在家聚餐婚礼祝福语简短
18 学生节祝福语大全简短