-
Hi everybody, Anybody that has ideas about how ti implement videogame nevagtion. use arrows, mouse or wasd keys to navegate the space in similar way than the Threejs examples? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@hugosoli , thanks for opening the discussion. See: https://www.harp.gl/docs/master/examples/#getting-started_free-camera.html This uses the TrackballControls from the three.js example, i.e.: import { TrackballControls } from "three/examples/jsm/controls/TrackballControls"; You would need to experiment with other means of navigating, we don't have any such navigation that uses wasd implemented, but it would be interesting for sure! |
Beta Was this translation helpful? Give feedback.
-
Happy! import { GeoCoordinates } from "@here/harp-geoutils"; const clock = new THREE.Clock(); const mapView = new MapView({ const mapControls = new MapControls(mapView); mapView.fog.enabled = false; window.addEventListener("resize", () => { const dataSource = new VectorTileDataSource({ const pointOfView = new THREE.PerspectiveCamera( const flycontrol = new FlyControls(pointOfView, mapView.canvas); const applyTransformControls = () => { mapView.addEventListener(MapViewEventNames.Render, () => { |
Beta Was this translation helpful? Give feedback.
Happy!
A working example using flynavigation. The problem at my understanding is that the main camara of the mapView can not be change. You could have secondary ones but the updateds of the tiles is done with such camera. Therefore, you have to tell mapview that the location of its camera is equivalent to the one you create for the fly. (ALL OF THIS COULD BE WRONG) However, studing closely the freecamera example I add that is was missing from my previous post. Here a working solution
import { GeoCoordinates } from "@here/harp-geoutils";
import { MapView, MapViewEventNames,MapViewUtils } from "@here/harp-mapview";
import { MapControls } from "@here/harp-map-controls";
import { VectorTileDa…