DirectX 3d Framing Transform

Source: Internet
Author: User

In the world coordinate system, both the geometry and the camera are defined relative to the world coordinate system. However, when the camera is positioned and facing arbitrarily, the projection transformation and other types of changes are slightly difficult or inefficient. To simplify the operation, we change the camera to the world coordinate system origin and rotate it so that the optical axis of the camera is in the same direction as the z axis of the world coordinate system. At the same time, all geometries in world space are transformed with the camera to ensure constant camera vision. This transformation is called the framing transform (view space transformation), and we call the transformed geometry in the viewing coordinate system (view space).

Suppose the camera is located (5,3,-10) and its observer point is the origin of the World coordinate system (0,0,0), we can create a framing transformation matrix like this.

5.0f,3.0f,-10.0f); // The position        of the camera in the world sitting system D3dxvector3 Target (0.0f0.0f0.0f// observed point        d3dxvector3 up (  0.0f1.0f0.0f// the upward direction vector d3dxmatrix V in the world coordinate system         ;        D3DXMATRIXLOOKATLH (&v, &position, &target, &up); // get the matrix of the framing change, i.e. the observation matrix

Framing transformations

// Framing Transformations

DirectX 3d Framing Transform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.