Skip to content

Commit

Permalink
Add ambient light to 3d scene
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Nov 28, 2024
1 parent 7158278 commit e30b49c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/Map3D.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Map from '@giro3d/giro3d/entities/Map.js';
import GeoTIFFSource from "@giro3d/giro3d/sources/GeoTIFFSource.js";
import {fromUrl} from "geotiff";
import PropTypes from 'prop-types';
import {Vector2, Vector3, Raycaster, CubeTextureLoader} from 'three';
import {Vector2, Vector3, Raycaster, CubeTextureLoader, AmbientLight} from 'three';
import {MapControls} from 'three/examples/jsm/controls/MapControls.js';

import {LayerRole} from '../actions/layers';
Expand Down Expand Up @@ -332,6 +332,9 @@ class Map3D extends React.Component {
});
this.sceneObjects = {};

// Light
this.instance.scene.add(new AmbientLight('white', 1));

// Setup map
const bounds = CoordinatesUtils.reprojectBbox(this.props.theme.bbox.bounds, this.props.theme.bbox.crs, projection);
const extent = new Extent(projection, bounds[0], bounds[2], bounds[1], bounds[3]);
Expand Down

0 comments on commit e30b49c

Please sign in to comment.