hsiao 5 years ago
parent
commit
a47b1c4642
2 changed files with 10 additions and 8 deletions
  1. 9
    7
      src/index.ts
  2. 1
    1
      src/shader_test.ts

+ 9
- 7
src/index.ts View File

118
                 if(mesh.material instanceof MeshStandardMaterial){
118
                 if(mesh.material instanceof MeshStandardMaterial){
119
                     let mat:MeshStandardMaterial = mesh.material;
119
                     let mat:MeshStandardMaterial = mesh.material;
120
                     mat .side = THREE.BackSide;
120
                     mat .side = THREE.BackSide;
121
+                    
121
                 }
122
                 }
122
             }
123
             }
124
+            
123
             /**
125
             /**
124
              * 加载二位图片作为场景背景
126
              * 加载二位图片作为场景背景
125
              */
127
              */
126
             this.textureLoader.load("./textures/skybox2.jpg", (tex) => {
128
             this.textureLoader.load("./textures/skybox2.jpg", (tex) => {
127
-                //this.scene.background = tex; //直接设置二维背景
129
+               // this.scene.background = tex; //直接设置二维背景
128
 
130
 
129
                 //设置天空盒子背景
131
                 //设置天空盒子背景
130
-                let skybox = this.createSphere();
131
-                if (skybox.material instanceof MeshStandardMaterial) {
132
-                    let mat: MeshStandardMaterial = skybox.material;
133
-                    mat.emissive = new THREE.Color(0x00ffff);
134
-                    mat.emissiveMap = tex;
135
-                }
132
+                // let skybox = this.createSphere();
133
+                // if (skybox.material instanceof MeshStandardMaterial) {
134
+                //     let mat: MeshStandardMaterial = skybox.material;
135
+                //     mat.emissive = new THREE.Color(0x00ffff);
136
+                //     mat.emissiveMap = tex;
137
+                // }
136
 
138
 
137
                 //this.scene.add(skybox);
139
                 //this.scene.add(skybox);
138
             });
140
             });

+ 1
- 1
src/shader_test.ts View File

9
         void main() {
9
         void main() {
10
             vPos=position;
10
             vPos=position;
11
             vPos.x += sin( time + vPos.z * 4.0 ) / 4.0;
11
             vPos.x += sin( time + vPos.z * 4.0 ) / 4.0;
12
-            vPos.y += cos( time + vPos.z * 4.0 ) / 4.0;
12
+            //vPos.y += cos( time + vPos.z * 4.0 ) / 4.0;
13
             gl_Position = projectionMatrix * modelViewMatrix * vec4( vPos, 1.0 );
13
             gl_Position = projectionMatrix * modelViewMatrix * vec4( vPos, 1.0 );
14
         }
14
         }
15
         `;
15
         `;

Loading…
Cancel
Save