Hi is there any way to get the X,Y,Z of mouse in direct3d after I translate and rotate the world matrix?
(Computer graphic) Getting mouse coordinate after translate and rotate the world matrix
208 Views Asked by Aldy syahdeini At
2
There are 2 best solutions below
0
Ivan Aksamentov - Drop
On
DirectX is completely unaware of mouse and any other input devices. It just is not what it cares about.
To get x and y coordinates you call Win32 API functions (this depends on framework you are using)
To get a z coordinate, you must implement Ray Picking. There is no uniform way, as this depends on how picked objects are implemented. Here are some tutorials on XNA Picking.
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in DIRECTX
- Decal renderer does not discard pixels properly
- how to fix CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH?
- Why do we only create one render target view?
- DirectX12 development, character steering problem
- DirectX rendering Transparency
- Which format should be more smooth for complex R8 textures - BC4 or BC7?
- Missing HLSL Debug Symbols with D3Dcompile in Visual Studio
- C++ DirectX compress 3D texture into 2D texture
- Nvidia HDR Encoder
- Delphi FMX: How to write a custom shader filter?
- Ternary operator with SamplerStates
- How to export symbols in rust binaries
- How can I safely alter a texture from multiple threads? (seems like there is no `InterlockedAdd`)
- How can I use (resource) barriers to sync access to a `RWTexture2D` between different shaders?
- Point light shadows work wrong, how can I debug it?
Related Questions in DIRECT3D
- Decal renderer does not discard pixels properly
- How do I dynamically change vertex colors using Direct3d 12 and Visual C++?
- Missing HLSL Debug Symbols with D3Dcompile in Visual Studio
- Unable to Display Cube in Direct3D Application
- d3d11 triangle rendering failure despite everything being properly initialized
- Anyone else notcing delays of shared d3dtexture2D betweeen two processes?
- Ternary operator with SamplerStates
- E_INVALIDARG when I encode the NV12 texture?
- How COM warning works? how does the device get initialized?
- imageStore causing crash in GL ES 3.1 Compute shader using ANGLE on windows
- How to use DirectX3D render gtk window on window platform?
- How to implement late latching in DirectX 12?
- Can I append vertexes to a default buffer using UpdateSubresources?
- Strange behaviour in google earth
- Why is D3D12GetDebugInterface failing with "no such interface supported" using Rust's windows-rs crate?
Related Questions in MANAGED-DIRECTX
- Directx 9 crashes when starting another program with administrator privilege
- System.Convert.ToDouble(decimal) giving two different answers
- Fake multi-monitor fullscreen in monogame: form can't be big enough
- Flip texture in DirectX9 (Managed)
- Rectangular Area Light Using In
- Area Light Implementation with directx9 or DX11
- C# MDX device.Reset failure on form minimize
- Draw Circle C# Directx
- When using Microsoft.DirectX.AudioVideoPlayback.dll in my project i'm getting Managed Debugging Assistant 'LoaderLock' has detected a error
- Ways of replace Managed DirectX?
- Creating a texture from a image in DX 12 VC++
- Directx 3D the farther object covers the nearer object
- How to play a wave file using SlimDX.DirectSound?
- Jerky animation when scrolling image in WPF using SharpDX
- Managed DirectX / SharpDX / SlimDX working without installer?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The mouse doesn't have a Z coordinate because it's not a three-dimensional pointing device.
The best you can do is project the mouse's (x,y) coordinate on the screen through the viewing frustum to determine which portion of the viewing frustum correlates to the pixel position under the mouse cursor.