{"id":522,"date":"2014-10-06T17:26:25","date_gmt":"2014-10-06T17:26:25","guid":{"rendered":"http:\/\/blogs.discovery.wisc.edu\/projects\/?p=522"},"modified":"2015-04-13T16:20:58","modified_gmt":"2015-04-13T16:20:58","slug":"rift-modifying-the-projection-fov-part-2","status":"publish","type":"post","link":"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/10\/06\/rift-modifying-the-projection-fov-part-2\/","title":{"rendered":"Rift: Modifying the Projection \/ FOV part 2"},"content":{"rendered":"<p>I&#8217;ve found a\u00a0path by which the\u00a0Oculus SDK generates the field of view (FOV):<\/p>\n<p><em>CalculateFovFromHmdInfo<\/em> calls <em>CalculateFovFromEyePosition<\/em>, then <em>ClampToPhysicalScreenFov<\/em>. \u00a0(It also clamps eye relief to a max of 0.006 meters, which is thus far not reproduced in my code.)<\/p>\n<p>All from OVR_Stereo.cpp\/.h.<\/p>\n<p><em>CalculateFovFromEyePosition\u00a0<\/em>calculates the<em>\u00a0<\/em>FOV<em>\u00a0<\/em>as four tangents from image center &#8212; up, down, left and right. \u00a0Each is simply the offset from image center (lens radius\u00a0+ the eye offset from lens center) divided by the eye relief (distance from eye\u00a0to lens surface). \u00a0It also does that weird correction for eye rotation mentioned in an earlier post; the max of the corrected and uncorrected tangents are used.<\/p>\n<p><em style=\"font-style: italic\">ClampToPhysicalScreenFov <\/em>estimates the physical screen FOV from a distortion (via <em>GetPhysicalScreenFov<\/em>). \u00a0It returns the min of an input FOV and the estimated physical FOV.<\/p>\n<p>Last week&#8217;s images were made using <em>Calculate<\/em>, but not <em>Clamp<\/em>. Clamping makes my FOV match the default, but adds odd distortions outside of certain bounds for eye relief (ER) and offsets from image center (which I&#8217;m deriving from interpupillary distance (IPD). \u00a0I haven&#8217;t yet thought much about why, but here&#8217;s some quick\u00a0observations in\u00a0the direction of\u00a0when (all values in meters):<\/p>\n<p>Values for ER less\u00a0than\u00a0-0.0018 result in a flipped image (the flipping is expected for negative values, so we would expect this to happen as soon as we dip below 0; the surprise is that it waits so long).<\/p>\n<p>Values of ER greater than 0.019 cause vertical stretch, fairly uniform in magnitude between top and bottom, and modest rate of increase. \u00a0It seems fairly gradual with the current stimulus.<\/p>\n<p>Those both hold fairly well for all values of IPD. \u00a0However, bounds on IPD are sensitive to ER.<\/p>\n<p>At negative values up to -0.0018, IPD doesn&#8217;t cause distortions (tested for values &gt;1 and &lt;-0.7). \u00a0It&#8217;s clearly entered some kind of weird state with negative ERs; something to keep in mind for future debugging \/ modeling, but we shouldn&#8217;t need negative ER directly.<\/p>\n<p>At ER of 0.0001, IPD distorts outside of range 0.0125\u00a0to 0.1145.<\/p>\n<p>At ER of 0.01, IPD distorts outside of range 0.034\u00a0to 0.094. \u00a0(This ER is the Oculus SDK&#8217;s default.)<\/p>\n<p>At ER of 0.019, IPD distorts outisde\u00a0of range 0.0535 to 0.075.<\/p>\n<p>Large IPD cause the image of both eyes to stretch away from the nose, small values towards. \u00a0The distortion is drastic and increases fairly quickly with distance from the &#8220;safe&#8221; range of IPD values.<\/p>\n<p>These ranges might be a little restrictive for our concerns, but should be workable; another worry\u00a0is that\u00a0the distortions may imply the clamping method itself is flawed.<\/p>\n<p>We&#8217;ll also need to be aware of when things get clamped when designing experiments that care about specific values for IPD and ER.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve found a\u00a0path by which the\u00a0Oculus SDK generates the field of view (FOV): CalculateFovFromHmdInfo calls CalculateFovFromEyePosition, then ClampToPhysicalScreenFov. \u00a0(It also clamps eye relief to a max of 0.006 meters, which is thus far not reproduced in my code.) All from &hellip; <a href=\"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/10\/06\/rift-modifying-the-projection-fov-part-2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":89,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,3],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/522"}],"collection":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/users\/89"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":6,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":530,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/522\/revisions\/530"}],"wp:attachment":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}