Hotspot visibility in virtual tour for VR headset - unity3d

I am creating virtual tour for VR headset in Unity - I create sphere and fill it with panoramic photo as material. For every sphere I create hotspots to switch to another scene after looking at it. I was testing it with Oculus Rift DK2. The sphere was visible, but the hotspots were visible all - for all scenes, but I need to see just hotspot for the current scene [1]. Anyone has idea hot to do it? Maybe something with transparency of spheres, but I saw just hotspots, not other spheres, so I think that sphere transparency is ok.
[https://i.imgur.com/F3S9C8w.png] - here you see also other scenes, in VR headset there are only hotspots, the spheres are not visible. This is right, but about hotspots - I need to see just that one for actual sphere, not all.
I was creating virtual tour according to this tutorial: https://tutorialsforvr.com/creating-virtual-tour-app-in-vr-using-unity/ ; you can see there also script for hotspots.
Thank you for all comments.

Make in your script public GameObject scena1Sphere, scena2Sphere, scena3Sphere;. And connect that game object from hierachy to sript fields. Then you can type:
//for first scene
scena1Sphere.SetActive(true);
scena2Sphere.SetActive(false);
scena3Sphere.SetActive(false);
//then when you switch to scene 2
scena1Sphere.SetActive(false);
scena2Sphere.SetActive(true);
scena3Sphere.SetActive(false);
// and for third scene
scena1Sphere.SetActive(false);
scena2Sphere.SetActive(false);
scena3Sphere.SetActive(true);

Related

How to change the AR Foundation Camera Rotation and position using joystick in Unity3d

I am creating a project like AR Portal in the AR foundation.
there are two modes in this:
AR Mode
Joystick Mode
Everything is going well with AR Camera and in AR mode.
In joystick mode, I am unable to rotate the camera and I am stuck on that problem and didn't find any solution.
If I disabled the Tracked pose Driver of AR Camera, then it will work but if I enable the Tracked Pose Driver, then it will not work.
Is it possible to rotate the camera when Tracked Pose Driver is enabled?
I'm not sure what you're trying to do there. AR camera is usually a physical camera, changing its position and rotation by code would not make a lot of sense. If you are using the joystick for a different scene/ part of the scene, try using a regular Unity camera and write a simple controller to move it around.

NavMesh surface does not work for all orientations

Unity has video tutorials about this where it claims to simply add NavMeshSurface component to an object and rotate the object to any orientation to get behaviors like walking on walls, etc.
However, this does not work for all orientations. Here is what happens when I try it out for a random surface. Note that I have a script that rebakes the NavMesh for every left mouse button click.
if(Input.GetMouseButtonDown(0))
surface.BuildNavMesh();
Link to view my video
I have a scene in HoloLens2 where walls are generated at runtime and I want a spider to walk on them. So naturally, I want NavMeshes to get generated on walls irrespective of their orientation. Please help.
Add comment

crosshair pointer enter on vuforia unity project

I have successfully enabled 3d object detection through vuforia in Unity. I have attached a crosshair (reticle) at the centre of the screen in screenspace overlay. when the user moves his phone over the 3d object which is produced upon object detection, I want a label to appear when crosshair crosses different parts of the 3d object. I tried many methods including, collision, cursor and reticle. It is not working.
Is there any easy way to implement this so that I can use event trigger pointer enter to make few things happening on the game.
I successfully solved my problem. The solution is using worldspace crosshair.
Most of the crosshairs available in the assets are cemeraspace. therefore using a worldspace corsshair solved my problem. It may be useful to someone in future.

Using PointCloud Prefab on Unity 3D

I tryed to implement the "Measure It" app on Unity 3D. I started with the PointCloud example scene downloaded on tango's website.
My problem is, when i look in 1st Person view, the point cloud don't fiel the screen, and when i look in 3rd Person I can see the point outside the Unity Camera FOV.
I don't see this problem on the Explorer app, but it looks to be made in Java so I think it's a Unity compatibility problem.
Does someone have the same problem, or a solution?
Unity 3D 5.1.1
Google Tango urquhart
Sorry for my poor english,
Regards.
EDIT :
It looks like the ExperimentalAugmentedReality scene is using the point cloud to place markers in real world, and this point cloud is right in front of the camera. I don't see any script difference between them so i don't understand why it works. If you've any idea.
I think it makes sense to divide you question into two parts.
Why the points are not filling in the screen in the point cloud example.
In order to make the points to fill in the first person view camera, the render camera's FOV needs to match the physical depth camera's FOV. In the point cloud example, I believe Tango is just using the default Unity camera's FOV, that's why you saw the points is not filling the screen(render camera).
In the third person camera view, the frustum is just a visual representation of the device movement. It doesn't indicate the FOV or any camera intrinsics of the device. For the visualization purpose, Tango explore might specifically matched the camera frustum size to the actual camera FOV, but that's not guaranteed to be 100% accurate.
Why the AR example works.
In the AR example, we must set the virtual render camera's FOV to match the physical camera's FOV, otherwise the AR view will be off. On the Tango hardware, the color camera and depth camera are the same camera sensor, so they shared a same FOV. That's why the AR example works.

unity3d - how to control the movement of the main Camera in Unity3d

I am trying to make an mobile application that contains AR(Augumented Reality)-Mode using Unity3D. So I have connected my mobile device with my unity3d program, and the camera works fine. But when move the mobile device, the main camera inside unity program does not move the same orbit that the mobile device moves. Does any one know how to change or control the orbit of the main Camera in unity3d?
This could be happening due to a number of reasons. It could be due to non centered pivots, or coordinate systems for example.
Could you please specify which AR system are you using? As a side note, at work we recently had a project involving Unity3d and Metaio and it was a nightmare to bend the system to do what we needed, specially when we needed to do a lot of object positioning based on the local coordinate system.
When you refer to the orbit of the camera, I imagine it could be that the pivot of the camera is somehow offset and the camera is rotating around that offset. Or maybe that the camera is a child of the actual Game Object that is controlled by the AR system, in which case this parent node acts as a pivot to the camera.
In the picture below you can see that the camera is away from that center point and when it rotates it does it based on that center point, in other words the camera always tries to look at that center point and it gives that feeling of "orbiting" when it moves.
Here's the link to the image (I can't post pictures yet on this forum -.- )
http://i.stack.imgur.com/fIcY2.png