directx

ID3DXMesh::CloneMesh breaks blend weights?

When I clone an ID3DXMesh with blend weights the blend weights end up breaking (but not completely, mostly the arms and fingers are skewed in strange directions), my code is very simple: LPD3DXMESH pTempMesh; if( model /*model is a mesh with animations, bone hierarchy, etc)) { if ( FAILED ( model->CloneMesh( model->GetOptions(), pDe...

Creating a matrix for a billboarded quad?

I'm trying to come up with a proper algorithm to create a matrix which gets the quad to face the camer straight up but I'm having difficulty. The quad I'm drawing is facing downwards, here's the code I have so far: D3DXVECTOR3 pos; pos = D3DXVECTOR3(-2.0f, 6.0f, 0.1f); D3DXMATRIX transform; D3DXMatrixTranslation(&transform, pos.x, pos....

Render a texture to a texture in Direct X using C#

Hey everyone, I am currently rendering an AVI stream as textures and displaying them out to the panel in C# using Visual Studio 2005 with the June 2010 version of the Direct X SDK. I would like to put some text onto the texture as a watermark or a logo on the bottom left. My question is how would I be able to save out the texture with t...

DirectX C# Camera: Calls to RotateX/Y/Z(float) render screen black.

I wanted to create a camera class, to allow for some simple camera controls. I only have OpenGL experience, so naturally I tried to imitate what I knew from there. Well, that failed miserably. I run the following function just before I start drawing my world objects. public void Align() { Matrix theMatrix = r_device.GetTransform(...

Binding a DCRenderTarget to a Printer DC

Hi all! Is it possible to bind a Direct2D DCRenderTarget to a Printer DC? I need to create a print using Direct2D. Is this even possible? Any help appreciated, cheers, Nothi ...

Understanding the behavior of IDirect3DDevice9::Present when it blocks for vsync

I'm developing a scientific application that has to estimate (as best as possible) the time difference between an object getting drawn in the video back buffer and the point at which that object actually becomes visible on the screen. In other words, how DirectX on Windows XP+ deals with monitor's vertical refresh cycle. I'll start by s...

Program Advice Directx with C#

Hey, What I am using: Visual Studio 2010 Windows Media Center Language C# The Program A part of my program needs to display movies by their covers and be able to scroll through them, much like netflix. I was told that directx would be good to accomplish this. Basically I just want it to be easy to view, use, and flow nice...

Cross compiling Direct3D on Linux with mingw

How to configure mingw32 to cross-compile Direct3D Apps for Windows? Is there any possibility? I have actually succeeded compiling code from this tutorial: http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B4.aspx - using Code::Blocks on Kubuntu with i586-mingw32msvc-g++. I needed to add #define UNICODE and remove the #pragma ...

drawing lines in 3D (DirectX)?

I'm adding lines to my 3D world like we see in 3D studio max. To draw lines I'm using a cylinder mesh and simply stretching/rotating it appropriately. That's all working fine but my problem is scale. Since it's 3D geometry rendering in perspective its size changes, from a distance it's small to invisible, up close it's huge. I want to m...

Cuda Runtime API and driver API questions

I am new to cuda and graphics. I had several questions about cuda, hope someone will have proper answers: These are for driver API: -- What is the meaning of a cuda context? when i was reading cuda c book (3.1) i've learned that it is analogous to a process in CPU. I don't understand this, the actual host c code becomes a process in cp...

HDR Rendering Pipeline DIfferences

What's the difference between a typical HDR rendering pipeline and a normal rendering pipeline? (i.e. bpp differences? Some additional post processing step?) ...

Fastest way to draw a series of Bitmaps with C#

I'm building an application that captures video frames from a camera (30fps @ 640x480), processes them, and then displays them on a Windows Form. I was initially using DrawImage (see code below) but the performance was terrible. Even with the processing step disabled the best I can get is 20fps on a 2.8GHz Core 2 Duo machine. Double buff...

4 Element Vector (3D Math)

Why is there a W term in a lot of 3D API's Vector class (i.e. Vector4(x, y, z, w) ) ? Are there math operations that absolutely require the W term? ...

C++ Syntax Question

What does the | mean? m_pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE); ...

ActiveX HWND, DirectX WindowLess mode

Hi. I would like to render video in ActiveX control (not in pop-up DirectShow window). I have: IID_IVMRWindowlessControl IID_IVMRFilterConfig9 CLSID_VideoMixingRenderer9 I would like to set WindowLess mode, but I don't know how to get HWND of..., exactly, of what? IEFrame, HTML element? hr = pWc->SetVideoClippingWindow(???); Anyo...

Algorithm for finding intersection point between two arcs

I am working in c# with directX, i need to find the intersection point between two arcs I searched the net but didn't find anything. I have StartPoint,EndPoint,StartAngle,EndAngle,Centre,Radius for both Arcs, now i need Algorithum or formula for finding intersection points between the two Arcs. ...

D3DXCreateTextureFromFileInMemoryEx gets stuck

Hello, I Use D3DXCreateTextureFromFileInMemoryEx to load a texture. It's working fine for first 3 files but at the 4th file it remains stuck. I use "break all" and the call stack shows calls from D3DX9_42.dll and at the top is ntddl.dll. I can't see function names. I use Win7 64 bits machine with VS2008 SP1. I let the application run f...

playing sound with SlimDX and DirectSound (C#)

(apologies if this is a duplicate ... i posted but saw no evidence that it actually made it to the forum) I've been trying to get SlimDX DirectSound working. Here's the code I have. It fills the secondary buffer from a wav file and then, in a thread loop, alternately fills the lower or upper halves of the buffer. It plays the first lo...

HLSL for getting cylinder effect

Hi all. I need to write an application with Silverlight 4 and need to show images like wrapped on cylinder. I need some HLSL code, as I wont to do that with Effects of Silverlight. I don't wont to do that with 3D libarries for silverlight. I only need HLSL code for changing pixels. I need for my image to look like this Thanks. ...

What is the best pratice to render sprites in DirectX 11?

I am currently trying to get used to the DirectX API and I am wondering what is the usual approach to render a sprite in DirectX 11 (e.g. for a tetris clone). Is there a simmilar interface as ID3DX10Sprite, and if not, which would be the usual method to draw sprites in DirectX 11? Edit: Here is the HLSL code that worked for me (the com...