{"id":192,"date":"2014-03-07T22:56:52","date_gmt":"2014-03-07T22:56:52","guid":{"rendered":"http:\/\/blogs.discovery.wisc.edu\/projects\/?p=192"},"modified":"2014-03-07T22:56:52","modified_gmt":"2014-03-07T22:56:52","slug":"mirrors-in-vizhome","status":"publish","type":"post","link":"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/03\/07\/mirrors-in-vizhome\/","title":{"rendered":"Mirrors in VizHome"},"content":{"rendered":"<p>Started exporting\/importing data about mirrors from SCENE into the VizHome viewer. Currently all surfaces with mirrors are manually preprocessed (to get rid of the false mirror points), so adding a few steps to this process seems okay for now.<\/p>\n<p>Right now it works like this: in the scan (2D) view, select a region of the mirror and delete these scan points. Then, redraw this region a bit larger and create a plane. Check in the 3D view that the plane aligns with the wall\/mirror. Then, in the 2D view again, create 4-many corner vertices of the mirror using plane\/intersection points and save them all in a VRML file.<\/p>\n<p>Now, SCENE is quite inconsistent when it comes to point\/model transforms and during export it does not apply the global scanner transform to these points. Additionally, the EulerAngle transformation provided by SCENE does not say which rotation is applied first. Luckily it also stores the rotatation in axis\/angle format. When loading the points in VizHome you therefore also have to specify the axis\/angle and translation as the global transform for each mirror.<\/p>\n<p>The current mirror file (for Ross&#8217; house) looks something like this:<\/p>\n<blockquote><p>new_mirror kitchen_mirror<br \/>\ntranslation 1.268844 2.561399 8.353854<br \/>\nrotation_axis -0 -0.002 1<br \/>\nrotation_angle 138.859284<br \/>\npoints 4<br \/>\n-5.09820000 1.16210000 2.61530000<br \/>\n-5.10310000 0.26780000 2.61300000<br \/>\n-4.95730000 0.26350000 1.41670000<br \/>\n-4.95220000 1.17380000 1.41860000<br \/>\nend_mirror<br \/>\nnew_mirror bathroom_mirror<br \/>\ntranslation 0 0 1.066999<br \/>\nrotation_axis -0.003 0.001 -1<br \/>\nrotation_angle 136.756113<br \/>\npoints 4<br \/>\n-0.09780000 1.14360000 5.32700000<br \/>\n-0.09620000 0.36530000 5.32200000<br \/>\n0.02890000 0.37050000 4.28740000<br \/>\n0.02730000 1.14700000 4.29170000<br \/>\nend_mirror<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>Most entries can be created by copy-pasting and the file supports multiple mirrors. Both mirrors have different transformations as they were marked on different scans. Once loaded, it currently looks like this:<\/p>\n<div id=\"attachment_193\" style=\"width: 698px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/mirror_detection.png\"><img aria-describedby=\"caption-attachment-193\" loading=\"lazy\" class=\"size-full wp-image-193\" alt=\"Mirror geometry loaded\" src=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/mirror_detection.png\" width=\"688\" height=\"669\" srcset=\"https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/mirror_detection.png 688w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/mirror_detection-300x291.png 300w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/mirror_detection-308x300.png 308w\" sizes=\"(max-width: 688px) 100vw, 688px\" \/><\/a><p id=\"caption-attachment-193\" class=\"wp-caption-text\">Mirror geometry loaded<\/p><\/div>\n<p>We also now have an (optional) background:<\/p>\n<div id=\"attachment_195\" style=\"width: 693px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/fancy-background.png\"><img aria-describedby=\"caption-attachment-195\" loading=\"lazy\" class=\"size-full wp-image-195\" alt=\"Background rendering\" src=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/fancy-background.png\" width=\"683\" height=\"659\" srcset=\"https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/fancy-background.png 683w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/fancy-background-300x289.png 300w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/03\/fancy-background-310x300.png 310w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/a><p id=\"caption-attachment-195\" class=\"wp-caption-text\">Background rendering<\/p><\/div>\n<p>Colors can be changed in the shader. The background is drawn using a single screen-filling quad and determining and interpolating the current view-vector for each vertex.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Started exporting\/importing data about mirrors from SCENE into the VizHome viewer. Currently all surfaces with mirrors are manually preprocessed (to get rid of the false mirror points), so adding a few steps to this process seems okay for now. Right &hellip; <a href=\"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/03\/07\/mirrors-in-vizhome\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/192"}],"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\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":2,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/192\/revisions\/196"}],"wp:attachment":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}