Tag Info

Hot answers tagged

7

In practice, even when a scene is built to minimise problems, a 360-degree-FOV camera tends to introduce so much distortion in some directions that its results are useless for most purposes. If you want to avoid the expense of rendering a full texture cube, you can get a similar effect by using dual paraboloid environment maps, in which you render two ...


4

The D3DX function D3DXMatrixOrthoOffCenterRH constructs an orthographic projection matrix based on the top/left/right/bottom coordinates of the view volume. Per the documentation, the formula used is: 2/(r-l) 0 0 0 0 2/(t-b) 0 0 0 0 1/(zn-zf) 0 (l+r)/(l-r) (t+b)/(b-t) zn/(zn-zf) ...


4

The short answer is: yes, it is possible, but since the projection you desire is nonlinear, you must do one of two things: Subdivide the geometry finely and implement the projection math in the vertex shader (or domain shader if using hardware tessellation), or Render a standard environment map (e.g. cubemap) first and then resample it to the desired ...


2

Rather than use the legacy D3DXMath, consider using DirectXMath instead Plus you get all the source in the header. This computes the matrix as a row-major, right-handed matrix: inline XMMATRIX XMMatrixOrthographicOffCenterRH ( float ViewLeft, float ViewRight, float ViewBottom, float ViewTop, float NearZ, float FarZ ) { ...


1

Though Fault's comment is correct, what I usually do is to store the rotation and translation and then recreate the view matrix when required. (Full article here). The gist of the idea is: (btw the type of camera you are creating is often referred to as an Arc-Ball camera.) public class ArcBallCamera { public ArcBallCamera(float aspectRation, ...


1

Assuming you are dealing with additive operations (i.e. rotation translation order is important). Generally you would want to update your Camera matrix in this order: Take identity matrix. Translate to FocalPoint Rotate to look in to the right direction Translate away from the FocalPoint by the DistanceFromFocal Same works with any Object that you want ...



Only top voted, non community-wiki answers of a minimum length are eligible