{"id":3720,"date":"2013-12-23T15:59:22","date_gmt":"2013-12-23T21:59:22","guid":{"rendered":"http:\/\/www.realtimerendering.com\/blog\/?p=3720"},"modified":"2020-04-25T09:24:15","modified_gmt":"2020-04-25T15:24:15","slug":"improved-graphics-transforms-demo","status":"publish","type":"post","link":"https:\/\/www.realtimerendering.com\/blog\/improved-graphics-transforms-demo\/","title":{"rendered":"Improved Graphics Transforms Demo"},"content":{"rendered":"<p>With the holidays upon us, it&#8217;s time to hack! Well, a little bit. I spent a fair bit of time improving my transforms demo, folding in comments from others and my own ideas. Many thanks to all who sent me suggestions (and anyone&#8217;s welcome to send more). I like one subtle feature now: if the blue test point is clipped, it turns red and clipping is also noted in the transforms themselves.<\/p>\n<p>The feature I like the most is that which shows the frustum. <a href=\"http:\/\/www.realtimerendering.com\/udacity\/transforms.html\"><b>Run the demo<\/b><\/a> and select &#8220;Show frustum: depths&#8221;. Admire that the scene is rendered on the view frustum&#8217;s near plane. Rotate the camera around (left mouse) until it&#8217;s aligned to a side view of the view frustum. You&#8217;ll see the near and far plane depths (colored), and some equally spaced depth planes in between (in terms of NDC and Z-depth values, not in terms of world coordinates).<\/p>\n<p><a href=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3729\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side.jpg\" alt=\"side\" width=\"629\" height=\"365\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side.jpg 629w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side-300x174.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side-500x290.jpg 500w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><\/p>\n<p>Now play with the near and far plane depths under &#8220;Camera manipulation&#8221; (open that menu by clicking on the arrow to the left of the word &#8220;Camera&#8221;). This really shows the effect of moving the near place close to the object, evening out the distribution of the plane depths. Here&#8217;s an example:<\/p>\n<p><a href=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3730\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side2.jpg\" alt=\"side2\" width=\"629\" height=\"365\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side2.jpg 629w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side2-300x174.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/side2-500x290.jpg 500w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><\/p>\n<p><span style=\"line-height: 1.4;\">The mind-bender part of this new viewport feature is that if you rotate the camera, you&#8217;re of course rotating the frustum in the opposite direction in the viewport, which holds the view of the scene steady and shows the camera&#8217;s movement. My mind is constantly seeing the frustum &#8220;inverted&#8221;, as it wants both directions to be in the same direction, I think. I even tried modeling the tip where the eye is located, to give a &#8220;front&#8221; for the eye position, but that doesn&#8217;t help much. Probably a fully-modeled eyeball would be a better tipoff, but that&#8217;s way more work than I want to put into this.<\/span><\/p>\n<p>You can try lots of other things; dolly is done with the mouse wheel (or middle mouse up and down), pan with the right mouse. All the code is downloadable from\u00a0<a href=\"https:\/\/github.com\/erich666\/cs291\">my github repository<\/a>.<\/p>\n<p>Click on image for a larger, readable version.<\/p>\n<p><a href=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3728\" src=\"http:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4-1024x604.jpg\" alt=\"transforms4\" width=\"500\" height=\"294\" srcset=\"https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4-1024x604.jpg 1024w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4-300x176.jpg 300w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4-500x294.jpg 500w, https:\/\/www.realtimerendering.com\/blog\/wp-content\/uploads\/2013\/12\/transforms4.jpg 1390w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the holidays upon us, it&#8217;s time to hack! Well, a little bit. I spent a fair bit of time improving my transforms demo, folding in comments from others and my own ideas. Many thanks to all who sent me suggestions (and anyone&#8217;s welcome to send more). I like one subtle feature now: if the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[562,563,547,560,523],"class_list":["post-3720","post","type-post","status-publish","format-standard","hentry","category-resources","tag-clipping","tag-demo","tag-three-js","tag-transforms","tag-webgl"],"_links":{"self":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/3720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/comments?post=3720"}],"version-history":[{"count":5,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/3720\/revisions"}],"predecessor-version":[{"id":5371,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/posts\/3720\/revisions\/5371"}],"wp:attachment":[{"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/media?parent=3720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/categories?post=3720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.realtimerendering.com\/blog\/wp-json\/wp\/v2\/tags?post=3720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}