0
這是我第二次使用three.js,我玩了至少3個小時。我似乎無法找到一個方向。使用three.js的Javascript 3D效果
我要打造的是這樣的: https://www.g-star.com/nl_nl/newdenimarrivals
我創建的場景和一切,但我似乎無法找到如何安排產品像這樣的公式或任何東西(更何況我必須事後處理點擊事件並將相機移動到該產品)。
你們有任何潛在客戶嗎?
編輯:
這是我儘量安排產品。
arrangeProducts: function() {
var self = this;
this.products.forEach(function (element, index) {
THREE.ImageUtils.crossOrigin = '';
element.image = 'http://i.imgur.com/CSyFaYS.jpg';
//texture
var texture = THREE.ImageUtils.loadTexture(element.image, null);
texture.magFilter = THREE.LinearMipMapLinearFilter;
texture.minFilter = THREE.LinearMipMapLinearFilter;
//material
var material = new THREE.MeshBasicMaterial({
map: texture
});
//plane geometry
var geometry = new THREE.PlaneGeometry(element.width, element.height);
//plane
var plane = new THREE.Mesh(geometry, material);
plane.overdraw = true;
//set the random locations
/*plane.position.x = Math.random() * (self.container.width - element.width);
plane.position.y = Math.random() * (self.container.height - element.height);*/
plane.position.z = -2500 + (Math.random() * 50) * 50;
plane.position.x = Math.random() * self.container.width - self.container.width/2;
plane.position.y = Math.random() * 200 - 100;
//add the plane to the scene
self.scene.add(plane);
});
},
編輯2:
我想通了:我需要補充約5透明同心cilinders,把產品上的每個(任意位置),並有攝像頭在所有cilinders中心並旋轉。 Buut,我如何隨機將圖像放在cilinider上?我真的有一個封鎖