对象Three-js上的光反射盘

时间:2017-01-26 05:12:50

标签: javascript three.js

我正在创建一个具有Three-js的地球场景,并且除了地球物体表面上存在的巨大讨厌的反射盘之外,它们的工作效果非常好。关于消除反射或至少在很大程度上减少反射的任何想法?

this file

照明 -

function CreateEarth(){
earth = new THREE.Object3D();
THREE.crossOrigin = "";
    var loader = new THREE.TextureLoader();
    var colorMap = loader.load("img/bodies/earth/colorMap.jpg");
    var bumpMap = loader.load("img/bodies/earth/bump.jpg");
    var specMap = loader.load("img/bodies/earth/specular.jpg");
    var earthGeometry = new THREE.SphereGeometry( 0.5, 32, 32 );
    var earthMaterial = new THREE.MeshPhongMaterial({
        map : colorMap,
        bumpMap : bumpMap,
        bumpScale : 0.05,
        specularMap : specMap,
        specular : new  THREE.Color("grey"),
        shininess: 25
    });
    earthMesh = new THREE.Mesh(earthGeometry, earthMaterial );
    earth.add(earthMesh);

function CreateEarthAtmosphere(){
    var loader = new THREE.TextureLoader();
    var cloudTexColorMap = loader.load("img/bodies/earth/cloudTexture.png");

    var atmosphereGeometry = new THREE.SphereGeometry(0.51, 32, 32);
    var atmosphereMaterial = new THREE.MeshPhongMaterial({
            map : cloudTexColorMap,
            /*alphaMap : cloudTexTransMap,*/
            side : THREE.DoubleSide,
            opacity : 0.5,
            transparent : true,
            depthWrite : false
    });
    atmosphereMesh = new THREE.Mesh(atmosphereGeometry, atmosphereMaterial);
    earthMesh.add(atmosphereMesh)
}

地球对象 -

public function gettable($username, $password){
    $cek_user = $this->db->query("SELECT hak_akses FROM tablelogin WHERE username = '$username' AND password = md5('$password')");  // Cek User Sudah Terdaftar
    if($cek_user->num_rows()>0){
        static $cek;
        foreach($cek_user->result() as $cek){
            $cek->hak_akses;
        }
        if($cek=='admin'){
            $ambil = $this->db->query("SELECT table_name FROM information_schema.tables WHERE table_schema='public' and table_name != 'tablelogin'");
            return $ambil->result();
        }
        if($cek=='semi_admin'){
            $ambil = $this->db->query("SELECT table_name FROM information_schema.tables WHERE table_schema='public' and table_name != 'tablelogin' and table_name != 'Film' and table_name != 'Hewan'");
            return $ambil->result();
        }
        if($cek == 'user'){
            $ambil = $this->db->query("SELECT table_name FROM information_schema.tables WHERE table_schema='public' and table_name != 'tablelogin' and table_name != 'Gudang' and table_name != 'inventaris' and table_name != 'Pegawai'");
            return $ambil->result();
        }
    }
    else {
        $hasil = null;
    }
} 

1 个答案:

答案 0 :(得分:0)

创建地球物体对象时,shininess: 25值可能会影响它的光泽度。

var earthMaterial = new THREE.MeshPhongMaterial({
        map : colorMap,
        bumpMap : bumpMap,
        bumpScale : 0.05,
        specularMap : specMap,
        specular : new  THREE.Color("grey"),
        shininess: 25 // lower this?

});