Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

Replacing Hololens Camera Position

Is it at all possible for me to simulate the Hololens Camera moving in a way I specify? For example, could I decrement the y value in a manner so as to make it look like the user is going down? I've tried to make this happen, but it doesn't seem to work.

Best Answer

Answers

  • @stepan_stulov How would you achieve the relative transform effect? I actually have a gps that I'm reading in data from so I can actively update my position, but I'm guessing I'm going to have to lerp the environment around me as I move. It's all a little hard for me to work out mathematically.

  • I've had exactly the same issue with a GPS unit like you. I achieved by parenting the "world" to a virtual camera (empty game object), then every position update I swap the 2 around (make the camera the parent and the world the child) and then move and rotate the virtual camera to the hololens camera. Bonus is that the Hololens handles position updates nicely in between GPS position updates. Just make sure that the position enters the Hololens as soon as possible with no delay.

    Still too bad that the environmental-spatial-understanding-mapping-stuff can't be turned off though.

  • @TetraTalon How do you connect to the GPS by the way? Bluetooth? I guess you also need some way to have a compass?

  • Hye, @TetraTalon

    Essentially you will need to convert a position+rotation between two coordinate systems. You will use these two methods I'd imagine:

    Transform.TransformPoint()
    Transform.InverseTransformPoint()

    Something along those lines:

    realObject.transform.localPosition = realCamera.transform.InverseTransformPoint(dummyCamera.TransformPoint(dummyObject.transport.localPosition));

    You'd need to take care of the rotations too. This code is just some quick thought and is not expected to be used directly. Additionally apply smoothing/lerp if necessary to prevent choppiness. As you see you don't need to deal with real math, vectors and quaternions. Unity's got a ton of convenient methods for transforming things there and back.

    Hope this helps.

    Building the future of holographic navigation. We're hiring.

  • @arjan_wiegel How frequently do you update? I'm using a UDP broadcast to get the gps position. Also, I've been able to disable the spatial mapping (since I'm trying to use this outside) by covering the sensors, and changing how the program reacts when tracking becomes unavailable. It's not a great solution, but it seems to work for now.

  • @stepan_stulov Thanks for the functions! Could you explain your real and dummy object concept a little further please?

  • summertaosummertao
    edited March 2018

    @arjan_wiegel said:
    I've had exactly the same issue with a GPS unit like you. I achieved by parenting the "world" to a virtual camera (empty game object), then every position update I swap the 2 around (make the camera the parent and the world the child) and then move and rotate the virtual camera to the hololens camera. Bonus is that the Hololens handles position updates nicely in between GPS position updates. Just make sure that the position enters the Hololens as soon as possible with no delay.

    Still too bad that the environmental-spatial-understanding-mapping-stuff can't be turned off though.

    Hi, i probably have the same situation here. I have external position tracking device binding on top of the hololens, i have tried many ways to update hololens transforming with the external tracking data, but some time the tracking can be very jittery especially if the headset is moving.
    Could you please give me more info about your approach? Such as what is the ”world” mean? and how to “move and rotate the virtual camera to the hololens camera”? Just assign the hololens camera’s position and rotation to the virtual camera?

  • @summertao a bit late, but hope it might be of some help:
    My tracking is also very jittery. The cause of this is the delay that the GPS/compass data is received.
    with the world I mean the root of the scene. Parenting something to "world"is just transform.parent=null.
    “move and rotate the virtual camera to the hololens camera” could be coded as:
    virtualcamera.transform.position=hololensCamera.transform.position;
    virtualcamera.transform.rotation=hololensCamera.transform.rotation;
    Hope this helps...

Sign In or Register to comment.