direct3d

Problem with D3D & COM

all the D3D interfaces are derived from COM's IUnknown interface, so I though I'd take an easy route for releasing D3D objects and use something like this: __inline BOOL SafeRelease(IUnknown*& pUnknown) { if(pUnknown != NULL && FAILED(pUnknown->Release())) return FALSE; pUnknown = NULL; return TRUE; } this doesn't...

Direct3D 11 effect files deprecated?

I've been playing around with Direct3D 11 a little bit lately and have been frustrated by the lack of documentation on the basics of the API (such as simple geometry rendering). One of the points of confusion brought on by the sparse documentation is the (apparent) move away from the use of effects for shaders. In D3D11 all of the effe...

Disable alt-enter in a Direct3D (DirectX) application

I'm reading Introduction to 3D Game Programming with DirectX 10 to learn some DirectX, and I was trying to do the proposed exercises (chapter 4 for the ones who have the book). One exercise asks to disable the Alt+Enter functionality (toggle full screen mode) using IDXGIFactory::MakeWindowAssociation. However it toggles full screen mod...

Direct3D: Draw textured cube with single DrawIndexedPrimitives call. Possible?

I am trying to draw a textured cube using just 8 vertices and one DrawIndexedPrimitives call. Is this even possible? I am having problems with the UV co-ordinates. I am finding it impossible to come up with suitable UV values which will work for all faces of the cube. Take the following numbering as an example: UV is set to (0, 0) ...

c++ d3d hooking - COM vtable

Trying to make a Fraps type program. See comment for where it fails. #include "precompiled.h" typedef IDirect3D9* (STDMETHODCALLTYPE* Direct3DCreate9_t)(UINT SDKVersion); Direct3DCreate9_t RealDirect3DCreate9 = NULL; typedef HRESULT (STDMETHODCALLTYPE* CreateDevice_t)(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD B...

C# : Direct3D in a control, AND fullscreen on a secondary monitor - what's the best way ?

I'm working on a C# application that needs to use Direct3D in a control in a windows form, AND (at the same time) fullscreen on a secondary monitor. Basically, I want a Windows Forms application on one screen with a user-interface to control the graphics, and I'd like to show preview-graphics in a small control, and full-blown superdupe...

Rotating a model in 3D: Suggestions for center of rotation

I need to allow the user to pan, rotate, zoom in/out of my scene in 3D which uses a parallel projection. Panning and zooming in/out has been pretty straight forward. However, when using the mouse for rotation, I am not sure what to use as the center of rotation. In particular, I am not sure at what depth inside the screen the center of r...

c++ IPC - d3d hook and directshow capture source

I'm writing an app that will basically be like Fraps, but it will push video frames as a DirectShow Capture Source. This will make it easy to stream games on websites like ustream, justin.tv, etc. I'm wondering what the best way to do the interprocess communication would be. Speed is very important. Right now I have a dll that is injecte...

Switch between active objects - understanding transform/view

Hello, it is something I don't understand on transforming (meshes). Please take a look at my code (which is in Render() function) first: foreach (GeometricObject obj in this.objects) { if (obj != this.activeObject) { obj.Mesh = MeshUtils.ChangeMeshColor(obj.Mes...

Direct3D - How do I calculate Roll from View Matrix?

Hey guys, this one's been eating up my entire night, and I'm finally throwing up my hands for some assistance. Basically, it's fairly straightforward to calculate the Pitch and Yaw from the View Matrix right after you do a camera update: D3DXMatrixLookAtLH(&m_View, &sCam.pos, &vLookAt, &sCam.up); pDev->SetTransform(D3DTS_VIEW, &m_View);...

Rendering GDI components to a buffer or d3d texture

Hi, I'm trying to redirect the output of a GDI application to a buffer, preferably a d3d texture but I'll settle for a system memory buffer that I can then copy to a d3d texture. Specifically, I'm trying to get Google Chrome to render into a d3d buffer to be displayed in a d3d application. Are there any foolproof ways to do this or am...

Direct3D device resizing

My application has a panel control associated with a Direct3D device. My problem is that when the panel is resized the backbuffer isn't resized accordingly witch leads to a bad quality in the direct3d display. How can I handle my panel resizing to set up correctly the device? ...

What is the simplest algorithm for mesh generation of an arbitrary quadrilateral?

What is the simplest algorithm for decomposing a quadrilateral into an arbitrary number of triangles? ...

Enabling Direct3D-specific features (transparency AA)

Hello. I am trying to enable transparency antialiasing in my Ogre-Direct3D application, but it just won't work. HRESULT hres = d3dSystem->getDevice()->SetRenderState(D3DRS_ADAPTIVETESS_Y, (D3DFORMAT)MAKEFOURCC('S', 'S', 'A', 'A')); /// returned value : hres == S_OK ! This method is taken from NVidia's technical report. I can enable t...

Managed Direct3D: Lock entire Vertex Buffer

I have a Mesh object returned from Mesh::TextFromFont and I am trying to set the color of each vertex. I am calling the vertex buffer's Lock function like this: mesh->VertexBuffer->Lock(0, LockFlags::None); However, this call throws an exception. Another overload of Lock seems to work fine, however it requires me to pass the rank of th...

How to read the 3D chart data with directX?

I am reading a open source project, and I found there is a function which read 3D data(let's say a character) from obj file, and draw it . the source code: List<Vertex3f> verts=new List<Vertex3f>(); List<Vertex3f> norms=new List<Vertex3f>(); Groups=new List<ToothGroup>(); //ArrayList ALf=new ArrayList();//fac...

SDL_Surface to IDirect3DTexture

Can anybody help with converting an SDL_Surface object, a texture loaded from a file, into an IDirect3DTexture9 object. ...

Direct3D: Vertex color component vs. IDirect3DDevice9::SetMaterial

What are the differences between the two approaches to coloring my Direct3D model? ...

3D Character/Model Creator

I'm in a project to create a 3d game using XNA/C#, and the game will use a lot of 3d characters. Looking at the current 3d games, in some they create near to hundreds of characters, what lead me to think that there are some good 3d character/model creator. To narrow the sample, the game will have characters like the game "Grand Chase"...

3 index buffers

So, in both D3D and OpenGL there's ability to draw from an index buffer. The OBJ file format however does something weird. It specifies a bunch of vertices like: v -21.499660 6.424470 4.069845 v -25.117170 6.418100 4.068025 v -21.663851 8.282170 4.069585 v -21.651890 6.420180 4.068675 v -25.128481 8.281520 4.069585 Then it specifie...