{"id":2484,"date":"2012-05-05T17:59:04","date_gmt":"2012-05-05T07:59:04","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=2484"},"modified":"2012-05-05T17:59:04","modified_gmt":"2012-05-05T07:59:04","slug":"a-different-perspective","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2012\/05\/05\/a-different-perspective\/","title":{"rendered":"A different perspective"},"content":{"rendered":"

\"\"<\/a>I was ill for part of last week, so haven’t made quite the progress on items that I wanted to.\u00a0 But I’m starting on the work needed for cascaded shadow maps, for really nice full-world shadow support.<\/p>\n

The first requirement for this is to be able to render an orthographic projection.<\/p>\n

Orthographic projections are actually pretty simple;\u00a0 they’re a view which has no vanishing point;\u00a0 objects don’t appear larger as they get closer to the camera, or smaller as they get further away.\u00a0 Oddly enough, this is the traditional sort of view used for most “tycoon”-genre games.\u00a0 The screenshot here is of a regular view into the MMORPG game world, taken from an orthographic camera.\u00a0 And.. I think I kind of like it, once real shadows are in.\u00a0 I’m starting to think about using this sort of view for general terrain editing and building placement modes, then going down into first-person perspectives for non-editing modes.<\/p>\n

Until now, the VectorStorm library had no native support for orthographic views;\u00a0 you could either render a flat 2D space, or you could render a perspective projection of a 3D space.\u00a0 I’ve now added support for orthographic views to the vsCamera3D.\u00a0 There are a whole host of changes under the hood which are needed to make use of this.\u00a0 But the upside is that you can now ask a vsCamera3D for its projection matrix;\u00a0 that’s no longer hidden inside the renderer.<\/p>\n

To use an orthographic view, set a camera’s projection type to “vsCamera3D::PT_Orthographic”, and set its field of view to the vertical distance you want to be rendering.\u00a0 The horizontal distance is automatically determined based upon the field of view and the aspect ratio (exactly as we were already doing on the vsCamera2D).<\/p>\n

Tomorrow, I’ll be hooking up a couple of shadow map renders to this sort of view.\u00a0 With any luck, I’ll get all the way through and be able to show demos of proper shadowing.<\/p>\n","protected":false},"excerpt":{"rendered":"

I was ill for part of last week, so haven’t made quite the progress on items that I wanted to.\u00a0 But I’m starting on the work needed for cascaded shadow maps, for really nice full-world shadow support. The first requirement for this is to be able to render an orthographic projection. Orthographic projections are actually…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,24,25,3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-E4","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2484"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=2484"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2484\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=2484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=2484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=2484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}