directx

Why won't Direct3D recover after unplugging a monitor in Windows XP?

那年仲夏 提交于 2019-12-10 16:51:28
问题 An interesting bug came up that I'm having no luck with. In a windowed Direct3D9 program using native code, I handle a device lost using something similar to the following: void MyClass::RecoverFromDeviceLost(LPDIRECT3DDEVICE9 deviceToRecover, D3DPRESENT_PARAMETERS devicePresentParams ) { HRESULT hr = deviceToRecover->TestCooperativeLevel(); if(hr == D3DERR_DEVICELOST ) { //Code to shutdown all D3DPOOL_DEFAULT allocated objects }else if(hr == D3DERR_DEVICENOTRESET){ hr = deviceToRecover-

How to get camera up vector from roll, pitch, and yaw?

ぐ巨炮叔叔 提交于 2019-12-10 14:25:20
问题 I need to get an up vector for a camera (to get the right look) from a roll, pitch, and yaw angles (in degrees). I've been trying different things for a couple hours and have had no luck :(. Any help here would be appreciated! 回答1: Roll, Pitch and Yaw define a rotation in 3 axis. from these angles you can construct a 3x3 transformation matrix which express this rotation (see here how) After you have this matrix you take your regular up vector, say (0,1,0) if 'up' is the Y axis and multiply it

Can I interpolate rotation from two Quaternions created from Yaw/Pitch/roll?

空扰寡人 提交于 2019-12-10 12:49:14
问题 Quaternions are good for interpolate rotations between them. so far so good. If I have a networking game, will it suffice to transfer the rotation as vector3f or should I use a quaternion? To make the game smoother I may have to interpolate between the last sent rotation and the current one. But can I interpolate rotations between two Quaternions which were created from Yaw/Pitch/Roll? Quaternion a = Quaternion.FromYawPitchRoll(x1,y1,z1); Quaternion b = Quaternion.FromYawPitchRoll(x2,y2,z2);

Error LNK2019: unresolved external symbol _wWinMain@16 referenced in function ___tmainCRTStartup

给你一囗甜甜゛ 提交于 2019-12-10 12:14:02
问题 I have started with DirectX 11 and get these compilation errors: Error 1 error LNK2019: unresolved external symbol wWinMain@16 referenced in function _ _tmainCRTStartup Error 2 error LNK1120: 1 unresolved externals(I figure that this error is because of the error just above this one) I have searched around for fixes to this problem for quite a while, yet I cannot find any fixes to this problem on this site or any other sites via google. I am using Visual Studio 2012 and c++ for this project.

why the sphere texture map can not actually match

落爺英雄遲暮 提交于 2019-12-10 12:09:22
问题 i have a sphere in my 3d project, and i have an earth texture, i use the algorithm from wiki to calculate the texture coordinate. the code in my effect file look like this: float pi = 3.14159265359f; output.uvCoords.x = 0.5 + atan2(input.normal.z, input.normal.x) / (2 * pi); output.uvCoords.y = 0.5f - asin(input.normal.y) / pi; the result is the picture below: look from left( there is a line, this is my question) look from front 3.look from right 回答1: Not pretend to be a complete answer at

Directsound logarithm volume to linear volume slider

自作多情 提交于 2019-12-10 11:39:18
问题 I am developing an music player with DirectX.DirectSound. I have a problem with the volume. The directsound volume is logarithm. This means that with silent sounds, is much more sensitive to small variations in amplitude than with loud sounds. It also means that with a linear volume slider we have a logarithmic sensation of volume variations, and that just doesn't feel right. My question is: How can I make it linear? My code until here is: if (trkBalance.Value == trkBalance.Minimum) {

SlimDX: Cannot see Direct3D debug output in Visual Studio 2010

我怕爱的太早我们不能终老 提交于 2019-12-10 11:28:50
问题 I've installed the June 2010 SDK Enabled the Debug Runtime in the DirectX Control Panel set the Debug Output Level to maximum (More) Enabled unmanaged code debugging. Result: The debug output from Direct3D is missing However if I start the application externally and use dbgview.exe, the output is shown there. What could be the reason for that? 回答1: After hours of trial and error I found a solution to my problem. Export your settings and check the value of the following setting: <PropertyValue

Texture streaming in DirectX11, Immutable vs Dynamic

旧街凉风 提交于 2019-12-10 11:19:19
问题 We often have the case where we need to stream textures to the graphics card (in game case: terrains, in my case image from different input sources like cameras/capture cards/videos) Of course in camera case, I receive my data in a separate thread, but still need to upload that data to the GPU for display. I know 2 models for it. Use a dynamic resource: You create a dynamic texture which has the same size and format as your input image, when you receive a new image you set a flag that tells

Speeding up an L-System renderer in C#/WPF

て烟熏妆下的殇ゞ 提交于 2019-12-10 10:39:51
问题 lsys is a blazing fast L-System renderer written in CoffeeScript. Below is a simple renderer in C# and WPF. It is hardcoded to render this example. The result when run looks as follows: A mouse-click in the window will adjust the angleGrowth variable. The re-calculation of the GeometryGroup as well as building the Canvas usually take much less than a tenth of a second. However, the actual screen update seems to take much longer. Any suggestions for how to make this faster or more efficient?

DirectX world view matrix multiplications - GPU or CPU the place

帅比萌擦擦* 提交于 2019-12-10 10:27:34
问题 I am new to directx, but have been surprised that most examples I have seen the world matrix and view matrix are multiplied as part of the vertex shader, rather than being multiplied by the CPU and the result being passed to the shader. For rigid objects this means you multiply the same two matrices once for every single vertex of the object. I know that the GPU can do this in parallel over a number of vertices (don't really have an idea how many), but isn't this really inefficient, or am I