196 views

### 2D Vector Compass Direction [duplicate]

Relating to this question; What's the best way of transforming a 2D vector into the closest 8-way compass direction? My query is if this would work in the following order(below) and if so, how ...
103 views

### How to determine the best approximate direction [duplicate]

I want to determine which sprite to use when one agent is "facing" another agent. My game is 2d, and uses 8-directional movement. Deciding which sprite to use for movement is easy enough since there ...
24 views

### Divide screen in eight sectors [duplicate]

Currently in our game we use a 4 directional movement. Some abilities are triggered on mouse click and "fired" in the direction the player has clicked. For this, I have split the screen in 4 sectors (...
4k views

### Is there a quick way to determine if a vector is in a quadrant?

I am wondering if there is a quick easy way to determine if a given vector is in a specified quadrant. In the below image, I've define the ranges of the blue quadrants. For example, if I am given a ...
1k views

### Finding vectors with two points

We're are trying to get the direction of a projectile but we can't find out how For example: [1,1] will go SE [1,-1] will go NE [-1,-1] will go NW and [-1,1] will go SW we need an equation of ...
1k views

### Choosing the correct isometric character facing direction

I am currently building a 3D game presented from a 2D isometric viewpoint. The 3D coordinates start at the top left corner of the screen with x and y increasing towards the right and bottom edges ...
613 views

### From 3d rotation, snap to nearest 90 directions

I have a 4x4 transformation matrix, made only from successive rotations and translations, and I'd like to "snap" my object to the "nearest" of the 24 orthogonal (multiples of 90 degree) rotations. I'...
520 views

### Position of an object relative to another in a 2D plane

I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position? If I where to just check each coordinates I could do it like this:...