directx

find out which polygon were front facing (drawn) after the rasterization stage

ぐ巨炮叔叔 提交于 2019-12-13 18:25:22
问题 I want to be able to access the polygon id (PrimitiveID) of the the front facing polygons of a mesh. I can only see this happening after the rasterizer stage, in the pixel shader. I was thinking about creating an append buffer but since the pixel shader is executed multiple times it might append the same polygon id more than once. I also thought about creating an array boolean variables and using the primitive id from the input assembler stage in the pixel shader as an index and set it to

Get world coordinates from D3DXIntersectTri

删除回忆录丶 提交于 2019-12-13 18:04:14
问题 I have a square area on which I have to determine where the mouse pointing. With D3DXIntersectTri I can tell IF the mouse pointing on it, but I have trouble calculating the x,y,z coordinates. The drawing from vertex buffer, which initialized with the vertices array: vertices[0].position = D3DXVECTOR3(-10, 0, -10); vertices[1].position = D3DXVECTOR3(-10, 0, 10); vertices[2].position = D3DXVECTOR3( 10, 0, -10); vertices[3].position = D3DXVECTOR3( 10, 0, -10); vertices[4].position = D3DXVECTOR3(

Calculate the absolute position of the point having the position before rotation and rotation angles

无人久伴 提交于 2019-12-13 17:16:03
问题 How can I rotate the point (x, y, z) by angles (rx, ry, rz) about their respective axes? That is, how do I determine the point (x1, y1, z1) resulting from the rotation of (x, y, z) by rotation angles (rx, ry, rz) ? Are there any DirectX routines which accomplish this? 回答1: What you are asking about is how to use Euler Angles for performing rotations. There are several conventions you can choose from, but it looks to me like you are interested in applying rotation about the Z axis, followed by

DSPACK example for converting audio sample rate on the fly?

不羁的心 提交于 2019-12-13 16:59:19
问题 I am using DSPACK with Delphi 6 Pro. I am looking for a good sample that shows how to create a filter graph that will convert the sample rate of an audio stream to a desired format (sample rate, bit depth, and number of channels) in real time. Does anyone know of a good example project that shows how to structure the filter graph with DSPACK to do this? If not with DSPACK, then if you know of a good example or web page that discusses the general DirectX filter graph concepts involved, I can

Is it legal to copy contents of one hlsl array to another using assignment on these arrays?

陌路散爱 提交于 2019-12-13 15:18:45
问题 In HLSL I have two arrays: int arr1[2]; int arr2[2]; I need to copy contents of arr1 to arr2 . Should I iterate through every element? arr2[0] = arr1[0]; arr2[1] = arr1[1]; Is there any specific HLSL tool (like memcpy() in C / C++ )? Or could I just write arr2 = arr1; and that will work for me? 来源: https://stackoverflow.com/questions/54041733/is-it-legal-to-copy-contents-of-one-hlsl-array-to-another-using-assignment-on-th

FreeType2 char copied to d3dtexture appears as double letters

◇◆丶佛笑我妖孽 提交于 2019-12-13 13:17:32
问题 I've recently just started using the FreeType library and have started to attempt copying from the buffer into directx9 textures. I'm currently getting however double letters appearing despite having copied from a buffer created through loading a single character as so : [copy attempt of the character 'a'] The following is my current code: void TexFont::freeTypeSave() { static FT_Library library; /* handle to library */ static FT_Face face; /* handle to face object */ if (FT_Init_FreeType(

How to convert UCHAR Virtual-Key Codes into std::string [duplicate]

早过忘川 提交于 2019-12-13 12:52:05
问题 This question already has answers here : Windows virtual key codes (2 answers) Closed 3 years ago . I'm working on a game option that change the keyboard setting. So, I want to display the key that player has changed. I have the issue to convert UCHAR key that contains a Virtual-Key Codes into std::string. Seem that GetKeyNameText() only cannot convert UCHAR into string as no string has been displayed on screen. How can I fix this issue? Thanks. Get keyboard message LRESULT Game:

What SDK should I use for DirectX 11?

删除回忆录丶 提交于 2019-12-13 12:21:10
问题 I am very confused on what I need in order to use the latest version of the DirectX SDK. There is the DirectX SDK (June 2010), which is apparently deprecated and there is the Windows SDK for Windows 8.1. What is so confusing is that I can't figure out if the Windows SDK for 8.1 will work using Windows 7 and Visual Studio 2013 for Desktop, or if I have to use the DirectX SDK (June 2010) with Windows 7 and Visual Studio 2013 for Desktop. Also, if I use Windows SDK for 8.1, how do I include it

How do I compile a directX tutorial sample in MingW

六眼飞鱼酱① 提交于 2019-12-13 08:56:46
问题 I have searched and searched and found no way to get directX to compile under MingW, I've seen others success and tried to replicate it to no avail. I've already read this similar question and it didn't help so please don't direct me to it: How to compile a DirectX 11 app in MinGW. I've been trying to get MingW to cooperate with directX for a long time now, here is a list of my failed attempts and what I've read worked for others: Download MSVC headers and have MingW use them Download MingW