-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature Request: Allow access to camera reference #43
Comments
this is already implemented if i'm not mistaken, although we must modify: initialize then pass the camera to Player in in OVRUI/lib/Player/Player.js add And finally pass the camera while creating VRInstance in client.js. The only drawback of this "patch" is that we have to calculate manually width & height (I just copied this from Player.js' camera implementation): // If container not specified, default to full window. const camera = new THREE.PerspectiveCamera(60, width / height, 0.01, 10000.0); I'm just starting out, so if this explanation wasn't clear i'll explain it further, although I think this patch might not be the ideal solution. |
I initially did it as you suggested, almost word for word but had some issues with passing my own camera, things didn't look right. In the end I added a function that returns a reference to the Player instance camera |
i'll reproduce it on a clean installation, I guess I forgot a step. Any meaningful error ? |
@morsdyce forgot to add the line about adding the camera to the instance initialization in client.js: |
Can't remember right now, tried lots of things that day.
It was either a black screen or it didn't sit right with the example PANO
…On Jan 30, 2017 23:52, "Dilip" ***@***.***> wrote:
i'll reproduce it on a clean installation, I guess I forgot a step. Any
meaningful error ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABlqIh8QxtlRmYbCA_Y_v5aOi89-RzaJks5rXlukgaJpZM4Lqc5Q>
.
|
the only time I had a black screen was because it need to get the width and height, so I just copied and pasted the width/height calculations done in Player.js when creating the camera. Btw do you have any idea how to use the sound module? looks like it's still broken (probably will open another thread but just in case..) |
Haven't tried yet, mostly in focus of creating scene composition and VR
controllers support.
…On Jan 30, 2017 23:57, "Dilip" ***@***.***> wrote:
the only time I had a black screen was because it need to get the width
and height, so I just copied and pasted the width/height calculations done
in Player.js when creating the camera. Btw do you have any idea how to use
the sound module? looks like it's broken still (probably will open another
thread but just in case..)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABlqIuccPx7vML6icl2i1-7EHWgtxlpvks5rXlyvgaJpZM4Lqc5Q>
.
|
@morsdyce well I ran the code in my local repo at home and just by passing the |
yes you can pass a camera to the Player instance or use Player.camera to get the default one that is created, and I agree it would be convenient to have these options on the VRInstance as well. |
Both 1 & 2 above are implemented. Added VRInstance.camera() to get current camera. Can also pass camera in the options to VRInstance constructor |
when I try to use VrInstance.camera() to get a camera it says that cannot read property camera from undefined, any help? |
Description
Currently React VR does not give you access or allow you to create your own camera.
I think this would be pretty helpful in case we want to manipulate the "player" location.
For example I implemented basic support for VR controllers using a native module, it makes sense that in the future i'd like to move around with either full locomotion (analog sticks) or teleportation (blink mechanic).
Solution
This can be fixed in 2 ways and should probably be implemented via both to allow maximum flexibility.
The text was updated successfully, but these errors were encountered: