googlearchive / vrview

Library for embedding immersive media into traditional websites.
http://developers.google.com/cardboard/vrview
Apache License 2.0
1.71k stars 1.09k forks source link

Changing FOV #231

Open bercium opened 7 years ago

bercium commented 7 years ago

Hi,

is there any easy way to change field of view? For spheres of tight spaces it looks really weird with the default one.

Thank you.

ichengde commented 7 years ago
window.worldRenderer.camera.fov = 90;
window.worldRenderer.camera.updateProjectionMatrix()
hutchij commented 6 years ago

I'm using the javascript api. The worldRenderer is not defined on window. How to modify the FOV?

ichengde commented 6 years ago

@hutchij You can use the javascript api in the embed iframe. But no external api can be used, you can add communication interfaces between the embed iframe and player.

https://github.com/googlevr/vrview/blob/bd12336b97eccd4adc9e877971c1a7da56df7d69/src/embed/main.js#L57

If you want finish change fov value fastly, you can hard code it. change 75 value. https://github.com/googlevr/vrview/blob/2dd890d147f702b9c561694bda5c86575c2a3d44/src/embed/world-renderer.js#L263

Menacer20 commented 5 years ago

Thankyou @ichengde. This is exactly the answer I've been looking everywhere for.