# Tagged Questions

A branch of mathematics concerned with questions of shape, size, relative position of figures, and the properties of space.

128 views

### Most efficient way to get the world position of the 8 vertexes of a Box Collider (C#)

What I am looking for is the most efficient way to get the world position of the 8 vertexes of the Box Collider of a freely rotated Gameobject. I cannot use collider.bounds since object is rotated, ...
147 views

### Finding new position after collision with multiple colliders

What is the most accurate way to find the correct position to where a moving character should be re-positioned as a collision-resolution, after it has collided with multiple colliders? The figure ...
806 views

### How do I efficiently check if a point is inside a rotated rectangle?

Part for the sake of optimization, part for learning purposes, I will dare to ask: How can I most efficiently check whether a 2D point P is inside a 2D rotated rectangle XYZW, using C# or C++? ...
769 views

### Are the first three values that describe a 3D plane actually a 3D vector?

A 3d plane is typically defined as a,b,c,d. Are a,b,c actually the x,y,z coordinates of a 3d vector, with d defining the rotation of the plane, something like axis-angle rotation data?
1k views

### How can I tell whether an object is moving CW or CCW around a connected path?

Lets say we have a jagged shape: And two creatures moving along it's outline. Then we smooth the shape completely by pulling the corners out. We get this: It is easy to see now that Orange is ...
627 views

### How do I calculate the distance between a point and a rotated rectangle?

This question is similar to another one about axis-aligned rectangles. However, I specifically want to calculate this for rotated rectangles. I have a rectangle with a (cx, cy) for the center ...
7k views

### How do I calculate distance between a point and an axis-aligned rectangle?

I have a 2D rectangle with x, y position, height and width, and a randomly positioned point nearby. Is there a way to check if this point might collide with the rectangle if it is closer than a ...
2k views

### How do I restrict the movement of a point to within a radius of another?

I have a situation where a sprite's center point needs to be constrained within a certain boundary in 2D space. The boundary is circular, so the sprite is constrained within a radius. This radius is ...
115 views

### Realistic angular velocity for rolling sphere in Unity 5.1

I'm trying to make a small 2D game with a rolling ball/sphere using Unity 5.1, but if find the angular velocity of the ball weird. On this first image (http://imgur.com/8wBoGms), you can see the ...
776 views

### Is there an efficient way to identify in which run-time generated room a character is, in a non-grid 3D environment? How?

Here is what I am trying to implement. I wrote a script that allows the player to place walls during run-time, in non grid-based 3D environment (walls can be diagonal with rotation increasing/...
41 views

### Detecting the two Vector3 that determine the bottom-edge of the side of a box-collider that had collision (with C#)

So, I understand that plenty of questions have been posted on how to detect which side of a Box Collider had collision. However, what I am trying to achieve is a little different. I want to find out, ...
140 views

### Calculating Minimum Translation Vector in Separating Axis Theorem based algorithm

In the 2D SAT collision determination algorithm, you project the convex polygons onto each potential separating axis. Supposing the polygons intersect, from what I understand, the axis for which the ...
108 views

### Optimal way to find point D that lays at the perpendicular line between point A and line BC

I am trying to write a script in C# to find the position of point D in 2D space in a specific scenario. I know the (X,Y) position of point A, which never happens to be on the line that contains the ...
128 views

### Rotate coordinates back after rotating game context (geometry)

To achieve something similar to the image below using HTML5 canvas one can simply write the following: var TO_RADIANS = 0.0174532925; context.translate(30, 20); context.rotate(30 * TO_RADIANS); ...
139 views

### What's the most efficient way to find the position of a point in relation to corners of a rectangle despite rectangle's scale

I am struggling to achieve the following with C# (in Unity). I need to find the position of the points that lay at a given distance (let's say 1m) from the corners of a rectangle, in a way that the ...
957 views

I'm currently trying to change my project to use GL_TRIANGLE_ADJACENCY instead of GL_TRIANGLES. Following this question, I have managed to construct my index buffer fine, but when it comes to the ...
467 views

### How to properly rotate towards a local point in Unity C#? (a local LookAt)

I am having a nightmare trying to make a child object rotate towards a given point of its parent object, similar to what is possible at the world level when using LookAt. The problem is that most ...
101 views

### Rotate perspective camera to align screen width to procedural object's width (Unity, C#)

I give up. After much trying and searching, I have to say I was unable to achieve the following task, for which I must call for your wise advice. In my current Unity 5 application (using C#), there ...
31 views

### Drawing shapes within a rectangle area

I am working on a Objective-c project where I need to draw multiple rectangle shapes inside a rectangle area like the attached image. Basically calculating CGPoints inside the CGRect. Thanks in ...
203 views

### Outline of plane slice of arbitrary object

How would you extract the outline of a shape from slicing a plane through an arbitrary object? Note: This is related to my Unity Answers question, but not exactly the same.
235 views

### How do I interpolate around a rectangle?

I want to make a fancy animation where a point travels around a rectangle. I want to find the point's position at a time t. The rectangle is given by X, Y, Width and Height. Is there an algorithm ...
93 views

### Is there a way of moving the transform of an object relative to it's geometry

I have a number of objects (mostly prefabs) that have their transform origin in inconvienient places such as about 1 unit to the left of the actual geometry or somewhere inside an object where it's ...
47 views

### Maya 2015 Collada mesh transforms not applied

I am trying to load a dae (Collada) model into my 3d engine. The problem is they export the vertices and transforms seperately. So in Maya 2015 it looks like this In the game engine I have it simply ...
139 views

### Sliding DOOM style collision resolution against arbitrary 2D geometry

I've been working on a HTML5 canvas raycasting engine for the web browser, with the end goal of making a simple FPS game in the style of the early 90s. The engine sits somewhere between Wolfenstein 3D ...
41 views

### boost/geometry replacement in Java/for the JVM (Destructable Box2D terrain)

I'd like to reimplement https://github.com/seemk/DestructibleBox2D in Java. The main problem is finding an adequate replacement for the boost/geometry library. Any ideas?
40 views

### 3D Picking: Doesn't Work Consistently

I'm trying to implement a 3D picking function that at the moment simply calculates the ray being sent from the camera after the user clicks the mouse on the window. It kind of works well when the ...
98 views

### Detect collision that happen between frames, between slices of moving, rotating circles?

To detect a collision between two circles, we check if the distance between their centers is smaller than the sum of their radii. To detect a collision between a slice (in this case half) of a circle ...
105 views

### Why is this unity camera moving in weird directions?

I have the following script public class CameraScript : MonoBehaviour { public bool AllowZoom; public float zoom; public float Speed; Transform board; void Start(){ ...
69 views

### Calculate land center on grid

I have a grid based game. The main map is 2d array with land ids, something like this (here are 2 lands on the map, one formed where the 1's are and one formed by where the 2's are): [ 1 , 2 , 2 ] [ ...
273 views

### Taking a 2D slice of a 3D volume

I have a regular 3D polygon and I'd like to display 2D slices of it. What is the best way to achieve this? (Preferrably in OpenGL, but a general algorithm/tecnique would be good as well). I've ...
2k views

### Geometry System of Populous: The Beginning [closed]

I want to to develop a game like Populous: The Beginning with my friend. But we could not find out what type of geometry they have used for the world. We know that - all tiles have the same size - ...
186 views

### which quarter of a triangle the point is in

I've got a world made out of squares. The square are devided in four triangles like this: The corners have their heights stored in a 2D array and the center height is the average of the corners. To ...
95 views

### Ortho projection of 3D points with a vector

I have 3D points and I need to make an 2D orthographic projection of them onto a plane that is defined by the origin and a normal n. The meaning of this is basically looking at the points from the top ...
155 views

### Suboptimal A* Pathfinding Solution Example using Manhattan Distance Heuristic

I believe using an overestimating heuristic with A* is not guaranteed to find the shortest path. Assuming an agent can travel as a bird using euclidean distances, the manhattan distance provides just ...
6k views

### How can I quantify a drawn line's straightness?

I'm working on a game which requires players to draw a line from a point A(x1,y1) to the other point B(x2,y2) on the screen of an Android device. I want to find how well that drawing fits to a ...
798 views

### How do you calculate the nearest point on 2 curves?

Given the points of a line and a quadratic bezier curve, how do you calculate their nearest point? .... Similarly, given the points of 2 curves, how do you get the nearest point?
371 views

### Rotate Object Towards Direction in 2D

For my RTS game's physics engine, I'm trying to find out a clever way to make a unit face the direction it's moving in. Given a Vector2d direction of movement (its normalized velocity), how can I ...
184 views

### Get quaternion between two objects on sphere

In a planetary gravity environment objects are represented in the following way: struct object { struct quaternion quat; // quaternion to represent the rotation between the object and the center ...
319 views

### Moving OBB vs. triangle intersection test

Requirements: to write a test function that, given a moving OBB (oriented bounding box) and a triangle, returns true whenever the OBB hits the triangle. The OBB is described by its half extents (h1, ...
168 views

### Mapping Coplanar Vertices in 3D space on to a 2D Plane

Say I have a plane specified by a normal vector and point on the plane. I want to specify a 2-D co-ordinate system that lies 'across' the plane, and then use that to find the 2-dimensional distance ...
2k views

### What is a good way to determine if a vector is between two other vectors in 2D?

I could operate with the angles, but I do not have the angles calculated yet (and would like to avoid having to do that). It would be possible to calculate and cache the local-coordinate-frame angles, ...
37 views

### Rotating between two coordinate frames

I have two coordinate frames, A and B. I want to create the rotation matrix RAB which takes you from A to B. A is a right-handed system, and B is a left-handed system. Furthermore, after moving from a ...
201 views

### Collision Detection algorithm using Line Detection

For a 2D physics sandbox I am working on, I need a way of detecting detecting a collision using lines. This sandbox uses a class called Particle, which has a x and a y (stored as a struct called ...
68 views

### How can i calculate that normal lays in same part of plane with point?

I.e. n0 for A and n1 for B. Plane divided by plane CD.
1k views

### Segment-Cylinder intersection

What is the complete code (C#, pseudo, does not matter) for calculating the resulting segment (or its absence) for the intersection of asegment and a cylinder? The segment is defined by Vector3(x,y,z)...
5k views

### How do I test if a circle and concave polygon intersect?

I have a polygon (sometimes convex, but often concave), and a bunch of circles with different radii. How can I find out if a circle is intersecting/overlapping with the polygon? I could split my ...
63 views

I've seen this video: all the geometry seems to grow and become fat. Nice effect. I'm just approaching the shader matter, and I'm still have to learn a lot about how to change geometry via shaders. ...
4k views

### Are the Minecraft animations hardcoded into the game? [closed]

I would like to know how the animation system works in minecraft. I get a feeling that all the mobs are hardcoded into the game. Did notch really sit there and create the matrices for all the ...