当前位置:   article > 正文

html3D创意相册附源码_使用html做3d图片立体酷炫源码

使用html做3d图片立体酷炫源码

(function () {

/* ==== definitions ==== */

var diapo = [], layers = [], ctx, pointer, scr, camera, light, fps = 0, quality = [1,2],

// ---- poly constructor ----

Poly = function (parent, face) {

this.parent = parent;

this.ctx = ctx;

this.color = face.fill || false;

this.points = [];

if (!face.img) {

// ---- create points ----

for (var i = 0; i < 4; i++) {

this.points[i] = new ge1doot.transform3D.Point(

parent.pc.x + (face.x[i] * parent.normalZ) + (face.z[i] * parent.normalX),

parent.pc.y + face.y[i],

parent.pc.z + (face.x[i] * parent.normalX) + (-face.z[i] * parent.normalZ)

);

}

this.points[3].next = false;

}

},

// ---- diapo constructor ----

Diapo = function (path, img, structure) {

// ---- create image ----

this.img = new ge1doot.transform3D.Image(

this, path + img.img, 1, {

isLoaded: function(img) {

img.parent.isLoaded = true;

img.parent.loaded(img);

}

}

);

this.visible = false;

this.normalX = img.nx;

this.normalZ = img.nz;

// ---- point center ----

this.pc = new ge1doot.transform3D.Point(img.x, img.y, img.z);

// ---- target positions ----

this.tx = img.x + (img.nx * Math.sqrt(camera.focalLength) * 20);

this.tz = img.z - (img.nz * Math.sqrt(camera.focalLength) * 20);

// ---- create polygons ----

this.poly = [];

for (var i = -1, p; p = structure[++i]

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/977075
推荐阅读
相关标签