Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Direct2D Matrix transformation mirror
    primarykey
    data
    text
    <p>I am currently learning DirectX (SDK of June 2010) and am drawing bitmaps to screen. Now I want to be able to do transformations on these images, and fail to mirror the images along the x- or y- axis.</p> <p>Before drawing, I am able to set a transformation matrix that will be applied to the drawing operations. Though DirectX is using the D2D1_MATRIX_3x2_F type, according to MSDN, only a 2x2 part of this matrix is used for transformations. For example, the matrix { [1, 0], [0, 1], [0, 0] } is the identity matrix that causes everything to be displayed naturally.</p> <p>As I understand it, a matrix transformation to mirror my image along the x-axis should look like this: { [1, 0], [0, -1], [0, 0] }, and along the y-axis it would then be { [-1, 0], [0, 1], [0, 0] }. If I use these matrices for the transformation however, I get a black screen.</p> <p>The problem for me is, that I am kind of stuck at this point without ideas what this problem could be caused by, or rather whether it is caused by a logical error in the mathematics behind this, or the implementation itself. Unfortunately, I could not find any material on this, besides a one line comment that "mirroring has to be done with matrix transformations" in the header file of the Direct2D RenderTarget.</p> <p>The source code I am currently using for testing this is:</p> <pre><code>D2D1_MATRIX_3X2_F m; m._11 = 1; m._12 = 0; m._21 = 0; m._22 = -1; m._31 = 0; m._32 = 0; m_pDX2DRenderTarget-&gt;SetTransform( m ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload