directx

Making an object orbit a fixed point in directx?

谁都会走 提交于 2019-12-25 03:38:15
问题 I am trying to make a very simple object rotate around a fixed point in 3dspace. Basically my object is created from a single D3DXVECTOR3, which indicates the current position of the object, relative to a single constant point. Lets just say 0,0,0. I already calculate my angle based on the current in game time of the day. But how can i apply that angle to the position, so it will rotate? :(? Sorry im pretty new to Directx. 回答1: So are you trying to plot the sun or the moon? If so then one

Making a screensaver [closed]

霸气de小男生 提交于 2019-12-25 02:59:29
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . No, I'm not talking about making a slideshow of pictures. How can I make the actual file that windows (at least windows 7) uses for

How to make a billboard spherical

♀尐吖头ヾ 提交于 2019-12-25 02:01:23
问题 Following this turorial here I have managed to create a cylindrical billboard (it utilizes a geometry shader which takes points and produces quads). The problem is that when i move the camera so that it's higher than the billboard (using gluLookat) the billboard does not rotate to truly face the camera (as if it was a cylindrical billboard). How do I make it into spherical? if anyone interested, here is slightly modified geometry shader code: #version 330 //based on a great tutorial at http:/

Delphi XE2: firemonkey playing video with libvlc?

懵懂的女人 提交于 2019-12-25 01:27:22
问题 I am still trying to play video on firemonkey using directx api with libvlc! I have played video using by different way already but I want to play video on directx surface. please looked this link first : http://forum.videolan.org/viewtopic.php?f=32&t=82618 someone write a delphi code about how to use libvlc on directx and that code working well, but this code is pure directx code. I want to integrate this code to firemonkey! How can I do it with firemonkey library(I know for windows

GDI and DirectX rendering

无人久伴 提交于 2019-12-25 01:23:31
问题 I have two windows, parent window where I'm rendering by D3D11 and second child window what I want to move over parent window. here is code how I'm creating windows: wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = 0; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(NULL,IDI_APPLICATION); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)0; wcex.lpszMenuName = 0; wcex.lpszClassName = L"Parent"; wcex

DirectX Font tutorial that doesn't use GDI

亡梦爱人 提交于 2019-12-24 21:18:03
问题 Does anyone have any tutorials/info for creating and rendering fonts in native directx 9 that doesn't use GDI? (eg doesn't use ID3DXFont). I'm reading that this isn't the best solution (due to accessing GDI) but what is the 'right' way to render fonts in dx? 回答1: ID3DXFont is a great thing for easy to use, early, debug output. However, it does use the GDI for font rasterization (not hardware accelerated) and there is a significant performance hit (try it, its actually very noticable). As of

SharpDx Save Bitmap to File

*爱你&永不变心* 提交于 2019-12-24 19:31:44
问题 I have a Sharpdx Direct2D1 Bitmap from the render target. I want to save it to a file as an image though. This is for test purposes. I am not sure if i need a WIC bitmap for that or how to convert these bitmaps. Or how to receive the WIC bitmap in the first place. Also i can't find an easy explanation how to save this bitmap to a file in general. Any help appriciated. Edit: I'm using this approach now: http://www.rolandk.de/wp/2013/06/inhalt-der-rendertarget-textur-in-ein-bitmap-kopieren/ It

DirectX 11 Render to Texture Issue

蹲街弑〆低调 提交于 2019-12-24 18:23:55
问题 In my code, i am making 2 rectangles, Rectangle1: Rendering On a Texture. Rectangle2: Rendering On Back Buffer. I am trying to do programmable blending,so need to access the destination pixel in pixel shader. In my code, I am creating a texture like below: d3d11Device->CreateTexture2D(&textureDesc, NULL, &renderTargetTextureMap); After this i am creating Render Target view of the texture. d3d11Device->CreateRenderTargetView(renderTargetTextureMap, &renderTargetViewDesc, &renderTargetViewMap);

Saving a Texture2D using SharpDX when targeting Win8.1 + Metro?

Deadly 提交于 2019-12-24 16:19:54
问题 I'm trying to save a user-generated Texture2D to disk, but it looks like the standard ways of accomplishing this aren't available when targeting DirectX11.1 / Win8.1 / Metro. ToStream/FromStream are absent, and the DX11 methods for writing a texture to disk are absent as well. Any ideas or suggestions? 回答1: Here's the general solution I ended up with. Getting a DataStream through mapping a texture resource is what got me on the right track. General flow is create a texture with CpuAccessFlags

Making a Model Loader: What to do after reading the vertices and texture?

一笑奈何 提交于 2019-12-24 16:01:27
问题 I recently started a small project within my DirectX 11 engine, which was to make a simple model loader. So far, all it does is open the file with the given file path and prepare to read from it. My question is this, once I read my vertices and texture data, what do I do with it to store it until rendering time? My idea was to put this data in a char array, but this would only work if I only loaded one model, or had many, many char arrays(one for each model). What I have now is this: Read