Comments (15)
@HHammerite , thanks for your bug report.
How are you adding the object to the mapAnchors
?
Setting the geoPosition
should work, see the render
method in MapView
, specifically the line:
this.m_mapAnchors.children.forEach((childObject: MapAnchor) => {
We position all of the children relative to the camera. This is how all objects are rendered, the camera is then located at 0,0,0 and all objects are rendered relative to it.
However we don't position the mapAnchors
object, its position would be at 0,0,0 in world space, so for example, if you are using globe projection, then the mapAnchors
object would be position in the center of the world, but the children are positioned correctly.
Does that help?
from harp.gl.
That has solved half of my problem! It is now correct. Thank you @nzjony! I just need to figure out the camera issue now.
from harp.gl.
@HHammerite , great to hear!
What camera issue are you dealing with, we have an orbiting camera example here if it helps: https://www.harp.gl/docs/master/examples/#getting-started_orbiting-view.html
from harp.gl.
@nzjony Thank you! What's the best way to keep updated on this?
from harp.gl.
Cool, thank you @nzjony
from harp.gl.
Here is another screenshot where I don't set the .geoPosition of the building after it's loaded.
from harp.gl.
Hi @nzjony,
Thank you for your reply! I am adding the object to mapAnchors like this
map.mapAnchors.add(scene);
where map is the mapView instance and scene is the main gltf scene.
That's good that the mapAnchors object is positioned at 0, 0, 0. This simplifies a lot.
I am adding the box helper like this
const box = new THREE.BoxHelper(scene); map.scene.add( box );
Is there a reason the box would be positioned like this?
from harp.gl.
I am adding the box helper like this
const box = new THREE.BoxHelper(scene); map.scene.add( box );
I think I see the problem, because the MapAnchor
is positioned relative to the camera, its position is updated each frame, you need to add an event listener to the map render call and update the box before it is rendered, something like:
map.addEventListener(MapViewEventNames.Render, () => {
box.update();
});
Does that help?
from harp.gl.
@nzjony I've been using this Orbit Camera . However I'm struggling to set it's orbit position to the MapAnchor. If I using the regular orbit camera from three it works without any issues, just that the orbit axis is wrong.
from harp.gl.
The reason I'm using this is because I need to set the camera's focus to specific parts of the building
from harp.gl.
@HHammerite, can you try updating the target each frame, i.e. under the box.update();
, make a call to set the target on the orbit controls?
from harp.gl.
That works! Awesome @nzjony! Thanks for your help. I have to ask for future reference, is there a way to get around all this continuous assignment & updating to simply interact with a MapAnchor?
from harp.gl.
@HHammerite , I agree that it is a bit cumbersome, i will create a separate ticket to improve the interface, as you say, it should be possible to just assign objects to the MapAnchor and not have to worry about updating their positions.
from harp.gl.
I created an issue: #1371
from harp.gl.
@HHammerite, otherwise can I close this issue?
from harp.gl.
Related Issues (20)
- Give 3D buildings that have 0m height data a random height between 2 values HOT 2
- Load building height data from different sources and combining with Here Maps (ex. Open Street Maps - OSM) HOT 2
- Allow CirclesTechnique points size to be specified in metres and pixels HOT 1
- MapView: Failed to connect to geojson: Error during worker initialization HOT 7
- Getting Started Guide is broken HOT 9
- Some countries has no shaped data at all HOT 2
- Maintaining "North up" in Spherical Map HOT 3
- big polygon broken in some level? HOT 2
- Optimisation possible for rendering. Only evaluate expressions for items which are in viewport. HOT 1
- Can I use anotherdata server? HOT 2
- Drawing exception problem HOT 4
- [feature] time-based tools HOT 3
- Equirectangular Tiles supported? HOT 3
- reactjs examples that work with current version of Harp HOT 8
- GeoJson is not being extruded. HOT 2
- Heatmap example is blank HOT 5
- Uncaught ReferenceError: THREE is not defined HOT 8
- Help with custom shader water layer HOT 4
- Docs and online examples is 404 HOT 3
- Do existing harp.gl users need to make any changes to match the new change? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harp.gl.