How can I rotate the map so that a mailbox marker is always visible using terrain mode? - mapbox-gl-js

I am plotting locations using mapbox GL JS and but when switching to 3D terrain the marker is sometimes behind a hill. This is signified by the marker appearing slightly more transparent.
I was wondering if there was a way to automatically position the camera so that it had a clear view of the marker when adding 3d terrain?

Related

Can I make a unity camera mask inside a shape?

Is there a way to render a camera only inside a sphere (or any 3D object)?
I want to render 2 cameras...each of them has different post processing effects...but one of them renders its effects in a spherical area around the player (with feathered edges if possible)...and the other renders the rest of the screen.

How do I get the 2d sprite gameObject in front of the UI Canvas?

hierarchy
2d sprite
panel UI
in game
Fist make sure your canvas' Render Mode is not set to Screen Space - Overlay.
If it is, then switch it to Screen Space - Camera and then change its Render Camera property to point to your main camera.
You can then use the following canvas' properties to control where it appears in relation to other sprites (which appears on top of which), the same way you control any other 2D Sprite:
Sorting Layer
Order in Layer
Also worth noting that 2D Sprites with same Sorting Layer and Order in Layer will use the distance to the camera to decide which one appears on top of which, and the same is true for the canvas:
If your canvas' Render Mode is set to Screen Space - Camera, it will always be positioned in front of your camera and you need to use its Plane Distance property in order to position it correctly.
If your canvas' Render Mode is set to World Space, you can position it freely in the world in the same way you position any other sprite.
First of all the hierarchy window in unity is completely irrelevant when its about positioning.
In Unity everything is 3D, even if you switch to 2D perspective.
So in your case you still have your camera, your sprite and your canvas in a 3D Dimension.
To set your sprite in front of the canvas you only need to increase the positioning stats (seen in your "panel UI" screenshot) at least slightly closer to your camera than the canvas is.

Unity3D: Position objects relative to Vuforia Image marker im multiple scenes

I have two scenes:
Scene1: User has to track Image marker.
Scene2: Display Objects relative to the image marker scanned in Scene1.
In Scene1 i attached "Vuforia Behaviour Script" to the MRKT camera. In Scene2 im just using the out of the box camera from MRTK (wihtout Vuforia Behaviour Script).
Is there any way to store the position data to archive this?
Im using Hololens2 With MRTK
You can use Spatial Anchor to track the special point in the world. When you are using this technology, you should note the locations where you create anchors should have stable visual features(that is, features that don't change often). For example, the physical surface you mentioned Vuforia image marker is not a good point to create anchors. However, it would be good practice to place anchors where they have stable visual features around Vuforia image markers and record the relative position of the image marker from the anchor.
If you are new to the Spatial Anchor, you can start from here: Spatial Anchor

How to get a circular view in unity

I am developing an application for Pico VR headset using Unity. The SDK has a prefab containing two camera.
I have added a quad and a script to change its texture at runtime.
Since the quad is rectangular and display is circular, my texture is unable to fill the screen. If quad is too close to camera, the corners cannot fit the display. If its so far that corners are able to fit inside the headset's display, I am able to see the background at the edges.
The display of HMD looks like a circle (may be spherical - because I have observed the texture that I apply on to the quad looks zoomed in when I run the app on the device). I want to add such object and configure my cameras so that they can view the entire texture of that object and nothing else.

Unity ARKit: project camera frame on detected plane as texture to render a top down view with second camera

I'm using Unity3D and ARKit and my goal is to project a camera image onto a plane detected with ARKit. So that I can render my plane with a second orthogonal camera in a brid's eye view. The result would be a textured map from top down view. The whole thing doesn't have to run in real time in the first version, it only should work for one frame on button click.
My current steps are:
freeze the frame on button click (ReadPixels to a UI Image)
duplicate the ARKit plane mesh, so that the plane is no longer extended and tracked
Now comes the problem, how do I get the camera image (which is stored in my UI image) correctly perspectivelly transformed on my plane? Do I have to do the transformation on the texture or in the shader?
How do I handle the case if the plane is larger than the current camera image? Do I have to crop the plane first? Like in the picture (case 2) only the green area can be textured.
From the ARKit plane geometry I can get the 3d vertices and the texture coordinates of the plane. I also can transfrom the World Coordinates to Screen, but I'm struggling with how and where to do the image transformation from screen to my detected plane.