Camera animation here SDK - here-api

Any tips how to do nice camera animation with the here SDK for flutter I can take examples from IOS or Android SDK.
The issue I’m facing is that in the example it shows animation with pre known camera zoom/distance to earth source and target.
In my example it’s difficult to find the right distance to earth given a bounding box and also find the center of a bounding box finally find the right bounding box to be able to comfortably see a set of GeoCoordinates.
Any tips much appreciated

There's nice bow-type animation example for Flutter. It's using custom Tweens.
If you want to zoom to a set of coordinates, use the MapCamera's calculateEnclosingCameraUpdate() method. It allows to zoom to a bounding box you can get from a route with route.getBoundingBox(). This way you can ignore the distance or center as the camera will automatically find the right value.

Related

How Style Own Position Icon with Bearing and Camera FOV

I have a flashing icon on a Mapbox GLJS map that shows the location of my software.
I would now like to indicate the direction of travel, similar to how google maps shows it. See image.
Once this is implemented, I would also like to adjust the width of the heading indicator based on the current FOV of my real-world camera. Ie Current camera FOV at 20 degrees would be shown as a 20-degree cone on the map.
Id have thought this is quite a common need, so is there any styling that can simply be plugged in? If not, any pointers of how to go about this would be welcome. Cheers
icon image

How to change the camera target without having that target automatically centered on the screen

Here is a playground to illustrate my problem: https://playground.babylonjs.com/#V181I2#34
On my scene I’m trying to replicate the camera’s behavior we have with paraview.
left drag → rotation around some point. OK
right drag → panning of the camera, but without changing the rotation center. I managed to do that using camera.targetScreenOffset thanks to a Playground I found here (https://playground.babylonjs.com/#EBPQH9#43 → many thanks to the author !)
Now on double click (for example) on a mesh, I would like to change the center of rotation to the center of the mesh, but again without having the targeted mesh centered on the screen, without having the current view changed the slightest.
I’ve been searching a lot how to do that without success.
From my understanding, in order for the target mesh not to be automatically centered:
modifying the camera position is useless. It would only change the perspective.
setting the right values for the targetScreenOffset would work. But I don’t know how to determine them. I’ve been looking for the right way to project a distance computed in the world coordinate system (between 2 successive camera targets) to coordinates for the targetScreenOffset property, without success. I don’t even understand the units used by that property.
there must be some other ways ?
Right now I don’t feel qualified enough to write the camera’s behavior from scratch.
Would anyone be able to help me or point me in the right direction?

After Effects Element 3D rotation bug

I don't know how to explain this but the objects I make in ELEMENT 3D aren't 3D but more like 2.5D.
I made a video so you can see the problem.
https://sendvid.com/s1hv1ay3
My recording software didn't record the Element interface at 0:24, but I was trying to show in that interface that you could rotate it without problems.
You're not understanding how Element3D (and aspects of the AE interface) work. Think of the layer you apply it to as being its own window "into a 3D world". You don't rotate the layer itself, you rotate the objects within the Element3D world by changing the parameters in the timeline or Effects controls pane. You were using the rotate tool in the video with the Element3D-effected layer selected. Don't do that. Use the individual parameters within Element. Another way to rotate around the 3D object(s) is to use the camera. I suspect this is what you were attempting after seeing a tutorial or something. What you do is make a two-node camera and use the camera tool by cycling through the tool with the "c" key until you get camera rotate, which looks a bit similar to the rotate layer tool. With a two-node camera, rotating the camera allows you to rotate around the point of interest of the camera so it rotates around the object in 3D space. I suggest you get a more familiar with how 3D works in AE (which is not "true 3D", not 2.5D, but is "Planar 3D"; the Element3D plugin is one of the best 3D-integrated plugins working within this model).
don't ever move the layer the element 3d model is on.
Use the element effects controls (f3). usually found in group 1

how to draw filled polygon in Google Maps SDK for iOS

I would like draw a filled polygon on iPhone with Google map (Version 1.1.1, the last one).
Anyone knows how to do like that on ios :
(My code on Android)
mMap.addPolygon(new PolygonOptions()
.addAll(latLngList)
.fillColor(Color.BLUE)
.strokeColor(Color.RED)
.strokeWidth(3));
Regards,
PS : If you have many solutions, keep in mind that I have many Polygon to draw.
The SDK currently doesn't support filled polygons, however there is a feature request to add them here:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=5070
In the meantime, one option could be to draw your polygons into an image, and then add them as a ground overlay. This would be very limiting, but might work as a temporary workaround.
Another option is to add another view over the top of the map view and draw the polygons into it, and then update them whenever the map view moves. It isn't possible to perfectly synchronize another view with the map view, so your polygons will lag behind a bit as you pan/zoom around, but this might also be okay for you as a temporary workaround.
UPDATE
These are just some random ideas to try for the ground overlay approach, I'm not sure if they would work, but they might get you started:
I would suggest converting the lat/lon corners of the rectangle into MKMapPoint (using MKMapPointForCoordinate). These are equivalent to Google's coordinate system at zoom level 20.
You can then use the aspect ratio of the width/height of the rectangle in MKMapPoint coordinates to determine the aspect ratio of your ground overlay UIImage. Once you have the aspect ratio, you'll just need to experiment with actual sizes (ie guess a width, calculate the height from the aspect ratio) to find one which looks okay. The bigger it is, the finer the detail of your rectangle will be, but the more memory it will use, and probably the slower the performance will be. Also you might hit a hard limit at some size - I'm guessing the UIImage gets converted by the Google Maps SDK into a texture, and textures have a max size of 2048x2048 on iPhone 3GS+.
Then, use something similar to How to setRegion with google maps sdk for iOS? to calculate a zoom level and centre lat/lon. Instead of the map view width/height you would use your UIImage width/height, and you'd use the bounds of your rectangle instead of the bounds of the desired view. You also wouldn't need to calculate the scale from both the width and height (as the scale should be the same) - so just use one of them. Instead of creating a camera with the zoom level and centre lat/lon, set them on the GMSGroundOverlayOptions. Also set the ground overlay's anchor to the centre of the image (ie 0.5, 0.5).
The above describes how to add one GroundOverlay per rectangle. If you have lots of overlapping or nearby rectangles you could probably combine them into a single UIImage, but that would be a bit more complicated.

three.js skydome with gradient

I would like to add a sphere with a 2d gradient as texture to create a skydome. I read that in openGL this is often solved by rendering the skybox without depthtest in an additonal pass.
I disabled depthTest on my sphere so everything else is drawn in front of it, it's kinda giving me the disired effect but depending on the camera angle it clips through other objects in my scene.
I was looking at several examples which make use of THREE.EffectComposer and a second scene, I may be completely after the wrong thing here but I think that could solve this. The thing is I havent ever touched the effectComposer and have no idea at all how to work with it and which things i exactly need.
I would aprreciate any input on this, maybe I'm after the wrong stuff at all.
Here are two three.js examples in which a skydome with a gradient is created. They do not involve EffectComposer or disabling depth test.
http://mrdoob.github.com/three.js/examples/webgl_lights_hemisphere.html
http://mrdoob.github.com/three.js/examples/webgl_materials_lightmap.html
three.js r.55
You dont have to use a cone or other 3D-geometry to simulate a gradient sky.
I solved it using a canvas (with 3 gradient-spots, lightblue -> white (horizon) -> darkblue) and draw it as sprite in front of my camera with the right distance to it (fog-distance).
You only have to manage the distance when moving/rotating your cam.
Tip: Use mesh.scale.set (xx,xx,1) to zoom the canvas-texture to needed size.

Resources