hsiao 5 лет назад
Родитель
Сommit
a47b1c4642
2 измененных файлов: 10 добавлений и 8 удалений
  1. 9
    7
      src/index.ts
  2. 1
    1
      src/shader_test.ts

+ 9
- 7
src/index.ts Просмотреть файл

@@ -118,21 +118,23 @@ export class FooGame {
118 118
                 if(mesh.material instanceof MeshStandardMaterial){
119 119
                     let mat:MeshStandardMaterial = mesh.material;
120 120
                     mat .side = THREE.BackSide;
121
+                    
121 122
                 }
122 123
             }
124
+            
123 125
             /**
124 126
              * 加载二位图片作为场景背景
125 127
              */
126 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 139
                 //this.scene.add(skybox);
138 140
             });

+ 1
- 1
src/shader_test.ts Просмотреть файл

@@ -9,7 +9,7 @@ export class VaringBox {
9 9
         void main() {
10 10
             vPos=position;
11 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 13
             gl_Position = projectionMatrix * modelViewMatrix * vec4( vPos, 1.0 );
14 14
         }
15 15
         `;

Загрузка…
Отмена
Сохранить