Search Results

Search found 164 results on 7 pages for 'direct3d'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Direct3D - Zooming into Mouse Position

    - by roohan
    I'm trying to implement my camera class for a simulation. But I cant figure out how to zoom into my world based on the mouse position. I mean the object under the mouse cursor should remain at the same screen position. My zooming looks like this: VOID ZoomIn(D3DXMATRIX& WorldMatrix, FLOAT const& MouseX, FLOAT const& MouseY) { this->Position.z = this->Position.z * 0.9f; D3DXMatrixLookAtLH(&this->ViewMatrix, &this->Position, &this->Target, &this->UpDirection); } I passed the world matrix to the function because I had the idea to move my drawing origin according to the mouse position. But I cant find out how to calculate the offset in to move my drawing origin. Anyone got an idea how to calculate this? Thanks in advance. SOLVED Ok I solved my problem. Here is the code if anyone is interested: VOID CAMERA2D::ZoomIn(FLOAT const& MouseX, FLOAT const& MouseY) { // Get the setting of the current view port. D3DVIEWPORT9 ViewPort; this->Direct3DDevice->GetViewport(&ViewPort); // Convert the screen coordinates of the mouse to world space coordinates. D3DXVECTOR3 VectorOne; D3DXVECTOR3 VectorTwo; D3DXVec3Unproject(&VectorOne, &D3DXVECTOR3(MouseX, MouseY, 0.0f), &ViewPort, &this->ProjectionMatrix, &this->ViewMatrix, &WorldMatrix); D3DXVec3Unproject(&VectorTwo, &D3DXVECTOR3(MouseX, MouseY, 1.0f), &ViewPort, &this->ProjectionMatrix, &this->ViewMatrix, &WorldMatrix); // Calculate the resulting vector components. float WorldZ = 0.0f; float WorldX = ((WorldZ - VectorOne.z) * (VectorTwo.x - VectorOne.x)) / (VectorTwo.z - VectorOne.z) + VectorOne.x; float WorldY = ((WorldZ - VectorOne.z) * (VectorTwo.y - VectorOne.y)) / (VectorTwo.z - VectorOne.z) + VectorOne.y; // Move the camera into the screen. this->Position.z = this->Position.z * 0.9f; D3DXMatrixLookAtLH(&this->ViewMatrix, &this->Position, &this->Target, &this->UpDirection); // Calculate the world space vector again based on the new view matrix, D3DXVec3Unproject(&VectorOne, &D3DXVECTOR3(MouseX, MouseY, 0.0f), &ViewPort, &this->ProjectionMatrix, &this->ViewMatrix, &WorldMatrix); D3DXVec3Unproject(&VectorTwo, &D3DXVECTOR3(MouseX, MouseY, 1.0f), &ViewPort, &this->ProjectionMatrix, &this->ViewMatrix, &WorldMatrix); // Calculate the resulting vector components. float WorldZ2 = 0.0f; float WorldX2 = ((WorldZ2 - VectorOne.z) * (VectorTwo.x - VectorOne.x)) / (VectorTwo.z - VectorOne.z) + VectorOne.x; float WorldY2 = ((WorldZ2 - VectorOne.z) * (VectorTwo.y - VectorOne.y)) / (VectorTwo.z - VectorOne.z) + VectorOne.y; // Create a temporary translation matrix for calculating the origin offset. D3DXMATRIX TranslationMatrix; D3DXMatrixIdentity(&TranslationMatrix); // Calculate the origin offset. D3DXMatrixTranslation(&TranslationMatrix, WorldX2 - WorldX, WorldY2 - WorldY, 0.0f); // At the offset to the cameras world matrix. this->WorldMatrix = this->WorldMatrix * TranslationMatrix; } Maybe someone has even a better solution than mine.

    Read the article

  • What sort of things can cause a whole system to appear to hang for 100s-1000s of milliseconds?

    - by Ogapo
    I am working on a Windows game and while rendering, some computers will experience intermittent pauses ("hitches" for lack of a better term). When profiled they appear in seemingly random places in the code. Eventually I noticed that it wasn't just my process that was affected, but (seemingly) every process on the system. All of the threads in my application hitch at once. The CPU utilization drops during these hitches and it appears as if most processes make no progress. This leads me to believe this may be an Operating System or Driver issue, but it only occurs while playing the game (and only on some systems). What sort of operations might the operating system be doing that would require the kernel to pause all user threads and block. Some kind of I/O? At first I thought of paging but my impression is that would only affect a single process, no? Some systems in use: Windows, DirectX (3d), nVidia cards (unknown if replicates on ATI), using overlapped io for streaming

    Read the article

  • Direct3D 11 effect files deprecated?

    - by Toji
    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 effect (.fx) support has been removed from the D3DX libraries and buried away in a hard to find (sparsely documented, of course) shared source library. None of the included examples use it, preferring instead to compile HLSL files directly. All of this says to me that Microsoft is trying to get people to stop using the effect file format. Is that true? Is there any documentation of any kind that states that? I'm fine doing it either way, but for years now they've been promoting the .fx format so it seems odd that they would suddenly decide to drop it.

    Read the article

  • Implement a 3D paint application: how to start?

    - by NewB
    Hello, I want to implement a paint-like application, which will enable kids to create and work with 3 dimensional objects. How can I start? What is the right approach? WPF, OpenGL, or Direct3D? (I prefer C# solutions, but C++ is OK also). Thank you all in advance! --NewB

    Read the article

  • DirectX capabilities on different graphics cards

    - by user9876
    I'm writing a Direct3D application, using DirectX 9. Although it works on my PC, I need to make it work on a wide range of systems. I need to know what capabilities I can expect to see on other systems. Is there a list of the DirectX capabilities that graphics cards support? I've found one site, which I'll post as an answer, but it's a bit out of date.

    Read the article

  • Software to capture 3d geometry?

    - by user712092
    Programs I found I found these programs to capture OpenGL 3D scene : 3D Ripper, OpenGL and D3D geometry capture, there are some solved problems with 3D Ripper GLIntercept captures OpenGL function calls OpenGL Extractor captures 3d geometry; should work as plugin for GLIntercept another tool to capture OpenGL 3D data EDIT: There is also HijackGL which changes how a scene is rendered so it probably can be used to capture geometry; it is backed up by a academic paper; it is just just a nice program, not related to what I want i think (or it would might be hard to change it to be for what I want, because it would require programming). 3D Ripper captures geometry, textures and shaders. OpenGL Extractor captures just geometry ... General questions about such programs What is Your experience with these programs? Which of these programs would You recommmend? Do You know other such programs? Were there any problems with them, or are there problems with them in general? Are there programs which work best overall, or is it specific to certain 3d applications? What I need to do? I am looking to program which can capture 3d geometry for study purposes. And also for a program to capture 3D animation (frames of 3d animation). I tried only 3D Ripper because application I try to capture data from is on Direct 3D. 3D Ripper works with at least Direct 3D 9, this application has Direct 3D 6. Are there applications which work with older version of Direct 3D? Thank You very much. :) (I was verbose in link names because I want them to be indexed better by search engines.)

    Read the article

  • What sort of things can cause a whole system to appear to hang for 100s-1000s of milliseconds?

    - by Ogapo
    I am working on a Windows game and while rendering, some computers will experience intermittent pauses ("hitches" for lack of a better term). When profiled they appear in seemingly random places in the code. Eventually I noticed that it wasn't just my process that was affected, but (seemingly) every process on the system. All of the threads in my application hitch at once. The CPU utilization drops during these hitches and it appears as if most processes make no progress. This leads me to believe this may be an Operating System or Driver issue, but it only occurs while playing the game (and only on some systems). What sort of operations might the operating system be doing that would require the kernel to pause all user threads and block. Some kind of I/O? At first I thought of paging but my impression is that would only affect a single process, no? Some systems in use: Windows, DirectX (3d), nVidia cards (unknown if replicates on ATI), using overlapped io for streaming

    Read the article

  • Drawing Rounded Rectangle in DirectX/3D for 2D

    - by Jengerer
    I'm using Direct3D to draw 2D elements in a C++ application of mine, and it'd be neat if I could create rounded-rectangle GUI elements that were varying in size, but I'm not sure how to do that in the most efficient manner possible. I thought of the "easy" way which would be to have images of the four corners and then just place them in the proper positions, and fill in the rest, but varying radii for the rectangle corners would be a definite plus, and this method doesn't accommodate that feature well. Through my searches I've come across the terms Pixel Shader, Stencil Buffering, and HLSL, but I'm not sure whether these terms are relevant and which one to jump into if so. Thanks in advance, Jengerer

    Read the article

  • How do I disable DirectDraw and Direct3D acceleration on Windows 8? [closed]

    - by Favourite Chigozie Onwuemene
    Some old games that i would really like to play run slowly on some graphic drivers when direct3d acceleration is enabled. I have tried many suggestions but none seems to work. The only thing i have not tried is disabling direct3d acceleration. Is it possible to disable DirectDraw and Direct3D acceleration on my Windows 8 pc? There are certain bad versions of GeForce drivers that cause this problem. This is a problem in the drivers themselves and is unfortunately completely outside our control. The recommended way to fix this problem is to update your graphics card drivers (go to NVIDIA's web site for this). Alternatively, there is a workaround that alleviates or solves the slowdown problem altogether. Try this: Right-click on your desktop and select "Properties". Go to the "Settings" tab and click on "Advanced...". Click on the "Troubleshooting" tab and move the slider to the left until it says that all DirectDraw and Direct3D accelerations have been disabled (around the middle of the range). Finally, click on "OK". Note that this workaround might cause other games on your computer to slow down, so you may have to switch back and forth between settings, but it's certainly worth a try if you can't obtain an updated graphics driver. -source: interactionstudios

    Read the article

  • For 2D games, is there any reason NOT to use a 3D API like Direct3D or OpenGL?

    - by Eric Palakovich Carr
    I've been out of hobby Game Development for quite a while now. Back when I did it, most people used Direct Draw to create 2D games. By the time I stopped people were saying OpenGL or Direct3D with an orthogonal projection is just the way to go. I'm thinking about getting back into creating 2D games, in particular on mobile phone but maybe on the XNA platform as well. To make something using OpenGL I'd have a (hopefullly) small learning curve to acclimate myself to 3D development. Is there any reason to skip that and instead work with a 2D framework where I just have a Width x Height frame buffer I need to fill with pixels?

    Read the article

  • How to read the 3D chart data with directX?

    - by MemoryLeak
    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();//faces always part of a group List<Face> faces=new List<Face>(); MemoryStream stream=new MemoryStream(buffer); using(StreamReader sr = new StreamReader(stream)){ String line; Vertex3f vertex; string[] items; string[] subitems; Face face; ToothGroup group=null; while((line = sr.ReadLine()) != null) { if(line.StartsWith("#")//comment || line.StartsWith("mtllib")//material library. We build our own. || line.StartsWith("usemtl")//use material || line.StartsWith("o")) {//object. There's only one object continue; } if(line.StartsWith("v ")) {//vertex items=line.Split(new char[] { ' ' }); vertex=new Vertex3f();//float[3]; if(flipHorizontally) { vertex.X=-Convert.ToSingle(items[1],CultureInfo.InvariantCulture); } else { vertex.X=Convert.ToSingle(items[1],CultureInfo.InvariantCulture); } vertex.Y=Convert.ToSingle(items[2],CultureInfo.InvariantCulture); vertex.Z=Convert.ToSingle(items[3],CultureInfo.InvariantCulture); verts.Add(vertex); continue; } And why it need to read the data manually in directX? As far as I know, in XDA programming, we just need to call a function a load the resource. Is this because it is in DirectX, there is no function to read resource? If yes, then how to prepare the 3D resource ? in XDA we just need to use other software draw the 3D picture and then export. but what should I do in DirectX?

    Read the article

  • 3D Character/Model Creator

    - by Click Ok
    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". There are some good (and easy) character model creator for to use in XNA development? Free is better, of course, but I will get payed versions too. EDIT: Another question is about the movements of the characters. The movements like walk, jump, sit, etc are "created" by the "character creator tool" or by the game?

    Read the article

  • 3 index buffers

    - by bobobobo
    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 specifies a bunch of normals like.. vn 0.196004 0.558984 0.805680 vn -0.009523 0.210194 -0.977613 vn -0.147787 0.380832 -0.912757 vn 0.822108 0.567581 0.044617 vn 0.597037 0.057507 -0.800150 vn 0.809312 -0.045432 0.585619 Then it specifies a bunch of tex coords like vt 0.1225 0.5636 vt 0.6221 0.1111 vt 0.4865 0.8888 vt 0.2862 0.2586 vt 0.5865 0.2568 vt 0.1862 0.2166 THEN it specifies "faces" on the model like: f 1/2/5 2/3/7 8/2/6 f 5/9/7 6/3/8 5/2/1 So, in trying to render this with vertex buffers, In OpenGL I can use glVertexPointer, glNormalPointer and glTexCoordPointer to set pointers to each of the vertex, normal and texture coordinate arrays respectively.. but when it comes down to drawing with glDrawElements, I can only specify ONE set of indices, namely the indices it should use when visiting the vertices. Ok, then what? I still have 3 sets of indices to visit. In d3d its much the same - I can set up 3 streams: one for vertices, one for texcoords, and one for normals, but when it comes to using IDirect3DDevice9::DrawIndexedPrimitive, I can still only specify ONE index buffer, which will index into the vertices array. So, is it possible to draw from vertex buffers using different index arrays for each of the vertex, texcoord, and normal buffers (EITHER d3d or opengl!)

    Read the article

  • (Ogre3D) Using a 3D texture slice as a 2D texture input.

    - by ~mech
    Hello, I am trying to do something with Ogre using 3D textures. I would like to update a 3D-texture by going through it slice-by-slice and recalculating the color values. However, in each step I also need to access the previous slice somehow to read the values. Setting up a slice as a render target is easy, but is it possible to feed such a slice as a 2D-texture input to a shader, or do I need to explicitly copy it into a separate 2D texture? Thanks.

    Read the article

  • ID3DXAnimationController.RegisterAnimationSet - How exactly is this supposed to work?

    - by TrespassersW
    I have a mesh file that contains the skinned mesh that I want, and then a bunch of separate animation files that contain various AnimationSets. I'd like to have my program dynamically build the list of AnimationSets available to a mesh at run-time. I know I can combine these into one mesh file using MView, but that isn't practical for what I'm planning. I thought this would be pretty simple since ID3DXAnimationController.RegisterAnimationSet seems like it exists to do exactly this and the MView mesh viewer program can do this. But when I call RegisterAnimationSet using an animation from a different file, it fails with an unhelpful Invalid Call return value. Both the skinned mesh and the animation were exported from the same 3DS file, so I'm pretty certain that they are compatible. Here's my code: var anim : ID3DXAnimationSet; am : IDxAnimMesh; begin fAnim := ResMgr.AnimFetch('man01.x'); am := ResMgr.AnimFetch('a_rigtest.x'); DXCheck(am.Controller.GetAnimationSet(0,anim)); DXCheck(fAnim.Controller.RegisterAnimationSet(anim)); end; The file "man01.x" contains a default animation. And "a_rigtest.x" contains an animation exported from a different portion of the timeline fromt the same 3DS file. So it seems like they should be compatible. MView combines them with no trouble. Am I doing something wrong? Does anyone know how this is supposed to work? Or better yet, does anyone know where I could find the source code to MView? Any help would be appreciated.

    Read the article

  • Dynamically generate Triangle Lists for a Complex 3D Mesh

    - by Vulcan Eager
    In my application, I have the shape and dimensions of a complex 3D solid (say a Cylinder Block) taken from user input. I need to construct vertex and index buffers for it. Since the dimensions are taken from user input, I cannot user Blender or 3D Max to manually create my model. What is the textbook method to dynamically generate such a mesh? Edit: I am looking for something that will generate the triangles given the vertices, edges and holes. Something like TetGen. As for TetGen itself, I have no way of excluding the triangles which fall on the interior of the solid/mesh.

    Read the article

  • Performance issue between builds

    - by DeadMG
    I've been developing a small indie game in my spare time and have run across an inexplicable issue. Some builds of the game will randomly run several hundred frames per second slower than other builds. For example, when rendering some text and no 3D scene, I can achieve 1800FPS on my own hardware. Add one 3D sphere (10k verts, pixel shaded), achieve 1700 FPS. Add two more spheres, achieve 800 FPS. Remove all spheres, achieve 1100FPS- even though the code now renders the same scene as I previously achieved at 1800FPS, which is just the FPS counter being rendered. I've tried rebuilding and cleaning the project and rebooting the compiler. This is in Release mode and I turned on all the optimizations I could find. Any suggestions as to the cause? I ran a quick profile, and Visual Studio seems to think that over 90% of my time was spent in D3D9_43.dll, suggesting that it's not a bug in my app, which doesn't explain why it manifests in only some builds. I rebooted my machine and it's back up to 1800FPS. I think it's a bug in the DirectX SDK tools (amongst many others). Going to delete this question.

    Read the article

  • Where have the Direct3D 11 tutorials on MSDN have gone?

    - by Cam Jackson
    I've had this tutorial bookmarked for ages. I've just decided to give DX11 a real go, so I've gone through that tutorial, but I can't find where the next one in the series is! There are no links from that page to either the next in the series, or back up to the table of contents that lists all of the tutorials. These are just companion tutorials to the samples that come with the SDK, but I find them very helpful. Searching MSDN from google and the MSDN Bing search box has turned up nothing, it's like they've removed all links to these tutorials, but the pages are still there if you have the URLs. Unfortunately, MSDN URLs are akin to youtube URLs, so I can't just guess the URL of the next tutorial. Anyone have any idea what happened to these tutorials, or how I can find the others?

    Read the article

  • What features does D3D have that OpenGL does not (and vice versa)?

    - by Tom
    Are there any feature comparisons on Direct3D 11 and the newest OpenGL versions? Well, simply put, Direct3D 11 introduced three main features (taken from Wikipedia): Tesselation Multithreaded rendering Compute shaders Increased texture cache Now I'm wondering, how does the newest versions of OpenGL cope with these features? And since I have this feeling that there are features that Direct3D lacks from OpenGL's side, what are those?

    Read the article

  • SharpDX/D3D: How to implement and draw fonts/text

    - by Dmitrij A
    I am playing with SharpDX (Direct3D for .NET) without using "Toolkit", already finished with basic rendering 3D models. But now i am wondering how to program/create fonts for game (2D), or how to simple draw variable text to output with Direct3D? (it is not as SharpDX question as common Direct3D question, how to start with game GUIs? And what should i do to program simple GUI's like menu for a game (generally i understand that it's shaders).

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >