Skip to content

Commit

Permalink
fixed reversal (google#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish authored Jan 9, 2024
1 parent 2a217a7 commit acfb155
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/model-viewer/src/three-components/GroundedSkybox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* limitations under the License.
*/

import {BackSide, BufferAttribute, Mesh, MeshBasicMaterial, SphereGeometry, Texture, Vector3} from 'three';
import {BufferAttribute, Mesh, MeshBasicMaterial, SphereGeometry, Texture, Vector3} from 'three';

export class GroundedSkybox extends Mesh {
private height = 0;
private radius = 0;
private resolution = 0;

constructor() {
super(undefined, new MeshBasicMaterial({side: BackSide}));
super(undefined, new MeshBasicMaterial({depthWrite: false}));
this.userData.noHit = true;
}

Expand Down Expand Up @@ -54,6 +54,7 @@ export class GroundedSkybox extends Mesh {

function makeGeometry(height: number, radius: number, resolution: number) {
const geometry = new SphereGeometry(radius, 2 * resolution, resolution);
geometry.scale(1, 1, -1);

const pos = geometry.getAttribute('position') as BufferAttribute;
const tmp = new Vector3();
Expand Down

0 comments on commit acfb155

Please sign in to comment.