Skip to content

Picking

Chuck Walbourn edited this page Apr 24, 2020 · 8 revisions

This lesson covers performing picking in 3D.

Setup

First create a new project using the instructions from the first two lessons: The basic game loop and Adding the DirectX Tool Kit which we will use for this lesson.

Ray casting

UNDER CONSTRUCTION

You can find an older tutorial on 3D picking using ray/object tests at Rastertek that uses the deprecated D3DXMath library. Note that instead of a 'roll your own' RaySphereIntersect you can use BoundingSphere from DirectXCollision.h with the following method to do the ray-sphere test:

bool Intersects(FXMVECTOR Origin, FXMVECTOR Direction, float& Dist) const;

Next lesson: Mixing SimpleMath and DirectXMath

Further reading

DirectMath Programmer's Guide
DirectXMath Collision sample

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Xbox One

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v18
  • MinGW 12.2, 13.2
  • CMake 3.20

Related Projects

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXTex

DirectXMath

Win2D

Tools

Test Suite

Model Viewer

Content Exporter

DxCapsViewer

Clone this wiki locally