Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Working with multiple Cameras VRED OpenVR HMD

9 REPLIES 9
Reply
Message 1 of 10
nharis7
738 Views, 9 Replies

Working with multiple Cameras VRED OpenVR HMD

Hi,

I have an model in VRED and I am using VIVE tracker to place it in the scene. 

Now I want to be in the middle of the model and for that I have to use teleportation. But now I don't want to use teleportation and got the idea that I should place a camera inside the model and after tracking I am enabling the camera. And when I enable the camera in HMD mode it is far off from it's position and I tried many ways by giving camera the translation of my desired location in hmd mode but nothing else seems to work.

Also I can move camera in hmd by just dragging the values in translation.

Please help me in this and how can I achieve this.

Thanks

Greetings

Harris

9 REPLIES 9
Message 2 of 10

Hi, when activating a camera while in VR, your relative position in the real world is applied to that camera.

Maybe you can try to activate via python the viewpoint management with

#vrImmersiveInteractionService.setViewpointMode(adjustHeight=True, adjustOrientation=True, adjustPosition=True)
vrImmersiveInteractionService.setViewpointMode(True, True, True)

this may retain your original viewpoint position once activated

 

vrImmersiveInteractionService.setViewpointMode(adjustHeightadjustOrientation=TrueadjustPosition=True)

Changes the default behavior for viewpoint selection. The actual camera position is the transformation of a viewpoint plus the transformation of the hmd. If adjustment is enabled, the camera position is modified in a way, that the resulting camera plus hmd position matches exaclty a viewpoint positon, height or orientation.

Parameters:
  • adjustHeight (bool) – If True, user is moved to the height of the viewpoint.
  • adjustOrientation (bool) – If True, user is orientated in the direction of the viewpoint.
  • adjustPosition (bool) – If True, user is moved to the position of the viewpoint.

 

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 3 of 10

Thank you Chris.

I will try these methods then will let you know if this works or not.

Greetings

Harris

Message 4 of 10

Hi Chris,

I have tried your solution but it does not work.

I found something in the documentation and now I am able to assign the translation but the rotations are not working. 

I am using vrNodeService to get the camera and then from it getting the worldTranslation and when I assign it to the other user camera in collaboration mode it works fine. When I try to get rotatioAsEuler it gives me the rotation and then I try to assign it to the other user camera in collaboration mode but it never works and also it doesn't raise any error. I am posting some of the code below. 

Hope that I made you clear.

vrNodeService.findNode("Perspective")

node.getRotationAsEuler()

node.getWorldTranslation()

 

Thanks

Best Regards

Harris

Message 5 of 10

Hi, i don't know if i have understood correctly...

i tried to force the camera position with "my calculated position", so, after you have the correct translation and rotation calculated, should be enough to set them to the camera

node = vrNodeService.findNode("Perspective")
node.setRotationAsEuler(QVector3D(0, 0, 0))
node.setWorldTranslation(QVector3D(0, 0, 0))

I got no errors and the camera goes where i want. I have not tried while in VR...

 

best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 6 of 10

Hi Chris,

Thank you for trying the code. It works perfectly fine when I am not in hmd/vr mode.

So, please test it in collaboration mode. Get the camera node from the code I have provided and send the translation, rotation of the camera to the other user connected in collaboration mode by using sendPython commands.

Basically what will you do you will take your camera translation and rotation and then you will be sharing your translation and rotation with other users. In this way all of the users will have the same translation and position as you have. But only the translation works not the rotation. And the other users are seeing in other ways or rotated to some other direction as they are.

Sorry, I cannot provide the code now as I don't have my other laptop but I will try to provide the code here on Monday. So, you can also have a look at that.

 

Cheers

Harris

Message 7 of 10
Anonymous
in reply to: nharis7

Hello,

I have worked on this issue for a long time.

Actually, when you set the translation and rotation of the camera, you are not setting the real position and rotation on that.

That is the position and rotation of the orignial point of the HMD tracking system.

If you have hardware model and want to get the real world and virtual world aligned very well, you should carefully calculate the offset between your VRED model coordinate system and the HMD tracking system.

 

But for your situtaion, i suggest that you can directly force the viewpoint.

And there are two things you should notice.

 

1, use following command.

vrImmersiveInteractionService.setViewpointMode(True, True, True)

2 deactive the viewpoint Transition in Camera Setting-Animation.

hanluqiang110_0-1618135838025.png

 

Then, You do not need to use VIVE tracker to track the VRED model. in VR mode, you just need to double clip the viewpoint. And you should be the position you want in VR.

 

 

 

Message 8 of 10

Hi @nharis7 ,

unfortulately I cannot test the collaboration mode. I’m Working from home and I have only access to one headset.

 

best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 9 of 10
nharis7
in reply to: Anonymous

Hi,

Thank you for your response.

I will try your solution and will let you know if it works. But you are telling me about the viewpoint and I am not using the viewpoints at all. And still I will give it a try.

 

Just a idea for what I trying to achieve on my side.

 

I am taking my camera position and assigning it to other users so that other users will have the same position and rotation as me. And they would be able to see what I am seeing Or what I want to show them. But only translation values assigned to the other users and I am also assigning the rotation but they don't rotate to the assigned values at all.

 

Thanks

Best Regards

Harris

 

Message 10 of 10

Hi,

Oh okay. Then I think I will figure out something by myself.

But thank you for your response and time.

 

Thank you

Best Regards

Harris

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report