Skip to content

Commit

Permalink
Add fixes for current version of three.js
Browse files Browse the repository at this point in the history
There have been many three.js changes since this app was last built -
these required some changes in our code to fix the scene up.
  • Loading branch information
nikolas committed Aug 31, 2023
1 parent c28eb3a commit 049ddcb
Show file tree
Hide file tree
Showing 4 changed files with 1,316 additions and 54 deletions.
1,253 changes: 1,251 additions & 2 deletions sun-motion-simulator/dist/bundle.js

Large diffs are not rendered by default.

96 changes: 52 additions & 44 deletions sun-motion-simulator/dist/bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,138 +5,146 @@ object-assign
*/

/*!
* @pixi/app - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/app - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/app is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/constants - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/constants - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/constants is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/core - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/core - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/core is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/display - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/display - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/display is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/extract - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/extensions - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/extract is licensed under the MIT License.
* @pixi/extensions is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/filter-displacement - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/filter-displacement - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/filter-displacement is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/math - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/math is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/mesh-extras - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/mesh-extras - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/mesh-extras is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/mixin-get-child-by-name - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/mixin-get-child-by-name - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/mixin-get-child-by-name is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/mixin-get-global-position - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/mixin-get-global-position - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/mixin-get-global-position is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/polyfill - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/polyfill - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/polyfill is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/prepare - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/prepare - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/prepare is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/ticker - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/settings - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/settings is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/ticker - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/ticker is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* @pixi/utils - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* @pixi/utils - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* @pixi/utils is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*!
* pixi.js - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
* pixi.js - v6.5.1
* Compiled Sun, 24 Jul 2022 20:56:21 UTC
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/*! For license information please see index.js.LICENSE.txt */
Expand All @@ -145,7 +153,7 @@ and limitations under the License.

/**
* @license
* Copyright 2010-2022 Three.js Authors
* Copyright 2010-2023 Three.js Authors
* SPDX-License-Identifier: MIT
*/

Expand Down
1 change: 1 addition & 0 deletions sun-motion-simulator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions sun-motion-simulator/src/CelestialSphere.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React from 'react';
import PropTypes from 'prop-types';
import * as THREE from 'three';
import WEBGL from './utils/WebGL';
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls.js';
import {FXAAShader} from 'three/examples/jsm/shaders/FXAAShader.js';
import {EffectComposer} from 'three/examples/jsm/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/examples/jsm/postprocessing/RenderPass.js';
import {ShaderPass} from 'three/examples/jsm/postprocessing/ShaderPass.js';
import {FontLoader} from 'three/examples/jsm/loaders/FontLoader.js';
import {TextGeometry} from 'three/examples/jsm/geometries/TextGeometry.js';
import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
import {FXAAShader} from 'three/addons/shaders/FXAAShader.js';
import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
import {ShaderPass} from 'three/addons/postprocessing/ShaderPass.js';
import {FontLoader} from 'three/addons/loaders/FontLoader.js';
import {TextGeometry} from 'three/addons/geometries/TextGeometry.js';
import {getDayOfYear, getEqnOfTime, getPosition, getTime} from './utils';
import MutedColorsShader from './shaders/MutedColorsShader';

Expand Down Expand Up @@ -116,6 +116,10 @@ export default class CelestialSphere extends React.Component {
renderer.setClearColor(0x000000);
renderer.shadowMap.enabled = true;

// TODO: this will be removed in the future, but necessary for now:
// https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733
renderer.useLegacyLights = true;

// Lights
const ambient = new THREE.AmbientLight(0x909090);
scene.add(ambient);
Expand Down Expand Up @@ -314,7 +318,7 @@ export default class CelestialSphere extends React.Component {
this.props.sunDeclination);
this.sun.rotation.x = this.props.sunDeclination;

this.light.position.copy(this.sun.position)
this.light.position.copy(this.sun.position);
this.light.rotation.x = this.props.sunDeclination;

if (this.props.showDeclinationCircle) {
Expand Down

0 comments on commit 049ddcb

Please sign in to comment.