Hi together, i am currently working on a WPF-based software for some basic CAD-funtionality. I herefore used this example Direct2DonWPF for using DirectX / D2D in a WPF control, which is working fine. I can draw what i want and the performance is good - EXCEPT the flickering when i draw to fast (>25fps). With GDI+ i was able to activate Doublebuffering and everything was fine. Now i'd need to implement the SwapChain from DirectX to get rid of this problem. Unfortunately, i found many tutorials and examples dealing with this issue, but none of them implements the SwapChain and D2D in WPF. I tried hours on hours to get it working, but on some random point i can't get it working.
Could someone help me understanding how to implement the SwapChain in the previously linked example, using D3DImage control etc.?
I would like to model the 3d object, consisted of two parts (A1 and A2). The angle between A1 and A2 is 150°. A1 and A2 are cylinders. The 3D object (A1 and A2) is lying on the XY plane.
I would like to rotate the 3d object around the A1 axis. The render plane has to be XZ. I don’t know how to rotate the 3d object around A1 axis. I use different combinations of the following functions:
D3DXMatrixRotationY(&R11, D3DX_PI * D3DXToRadian(0));
D3DXMatrixRotationAxis(&A1, &D3DXVECTOR3 (0.0f, 1.0f, 0.0f), D3DXToRadian(30));
D3DXMatrixTranslation(&T11, 20.0f, 5.0f, 0.0f);
HR(gd3dDevice->SetTransform(D3DTS_WORLD, &(R11 * A1 * R13/* * T11 * R13*/)));
Unfortunately I don’t understand how to create a child object (A2). When I rotate the object A1, the child object A2 has to be rotated automatically around the A1 axis.
Could you help to resolve the problem?
The linker is merely telling you that you forgot to provide a definition of the object that has been declared extern. You need to provide a line such as the following in one (and only one) of your source files:
DirectInput * gDInput = // add initialiser here, or in later code.