immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
91 stars 43 forks source link

[Question] Lences wide: #37

Closed konstantin55000 closed 4 years ago

konstantin55000 commented 4 years ago

Hello, sorry for posting here in issue thread.

konstantin55000 commented 4 years ago

i really need this answer for quesion: if there any possibility to change lence device frame , eq make lence frame x2 wider with the same height, but to preserve lence from distortion. Also viewport and canvas width should not be toched, just to simple reason : objects must be not distorted (not appear wider than needed). Please look at this screenshot http://prntscr.com/py3fre here white cursor is whider (ellypse form, need to stay circle), but lence should be this wide (width *2) I've looked through most methods inside cardborad-vr-display and webvr-polyfill, but yet not found solution. How it can be achieved?

konstantin55000 commented 4 years ago

Has been kinda figured: added into DeviceInfo.prototype.getLeftEyeVisibleScreenRect = function (undistortedFrustum) { var viewer = this.viewer; var device = this.device; var dist = viewer.screenLensDistance; var eyeX = (device.widthMeters - viewer.interLensDistance) / 2; .. var left = (undistortedFrustum[0] dist + eyeX) / device.widthMeters; ... return { x: left, y: bottom, width: (right - left ) viewer.lenceWidthMultiplier,
height: (top - bottom) * viewer.lenceHeightMultiplier

};

}; also in cardboardViewer added

function CardboardViewer(params) { this.lenceHeightMultiplier = 0.84; this.lenceWidthMultiplier = 1.5;

but maybe you' have more elegant solution. please let me know.