美文网首页
几何模型的创建

几何模型的创建

作者: 论宅 | 来源:发表于2018-11-23 17:47 被阅读0次

    球体

    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);
    

    相关文章

      网友评论

          本文标题:几何模型的创建

          本文链接:https://www.haomeiwen.com/subject/phfsqqtx.html