球体
var sphereGeometry = new THREE.SphereGeometry(4, 20, 20);
var sphereMaterial = new THREE.MeshLambertMaterial({
color: 0x7777ff
});
var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
scene.add(sphere);
正方体
var cube = new THREE.Mesh(new THREE.CubeGeometry(1, 2, 3),
new THREE.MeshBasicMaterial({
color: 0xff0000
})
);
scene.add(cube);
平面
var shadow = new THREE.PlaneGeometry(30, 50);
var ma = new THREE.MeshLambertMaterial({
map: new THREE.TextureLoader().load("assets/img/shadow.png"),
transparent: true,
});
backgroundPlant = new THREE.Mesh(shadow, ma);
scene.add(backgroundPlant);
网友评论