# LabA11 Picking and Collision Detection

<figure><img src="https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2FL5DUyX5GitJSNKdHfbeo%2Fimage.png?alt=media&#x26;token=c0720bd2-d645-4ce0-83d3-a29e94841f13" alt="" width="375"><figcaption></figcaption></figure>

## Source Code

{% embed url="<https://github.com/zhaoyoubing/proj02/tree/LabA11_AABB>" %}

## Tasks

### 1. Play with the code

#### Picking

Use your mouse to click on the scene rendering

#### Collision Detection (CD)

Use the keyboard arrow keys and "+", "-" to move along the major axes in the world space

### 2. Read the code

### 3. Try to use picking and CD in your coursework

You are encouraged to use GenAI to help your work.

## Notice of Limitations of the Code

1. Only intended for demonstration of basic picking and collision detection.
2. For simplicity, it only uses a mesh list and build the grid/octree into each mesh model itself.&#x20;
3. No support of Scenegraph.
4. Picking does not take occlusion into account.
5. Very rudimentary class design.
6. Improvements needed for memory efficiency.

## Tutorial

{% embed url="<https://learnopengl.com/In-Practice/2D-Game/Collisions/Collision-detection>" %}
