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

learn more… | top users | synonyms

0
votes
0answers
17 views

Making a node map with PNG alpha channels

I currently creating a 2d game that requires the usage of boats that travel from one country to another. The countries are individual objects with there own png. Nehow I've got the original map of the ...
2
votes
2answers
29 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 ...
-1
votes
1answer
50 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(){ ...
1
vote
1answer
56 views

How can I mask this CanvasRenderer?

I'm creating a text box that allows for selectable text, based off of Unity's InputField. An issue I am now facing is that the selection highlight does not respond to masks (The parent has a mask, but ...
0
votes
2answers
49 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 ] [ ...
1
vote
0answers
55 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 ...
0
votes
1answer
48 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 ...
1
vote
1answer
45 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 ...
4
votes
1answer
85 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 ...
32
votes
9answers
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 ...
0
votes
1answer
68 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.
0
votes
1answer
153 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 ...
0
votes
1answer
34 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 ...
2
votes
1answer
53 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 ...
0
votes
2answers
91 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, ...
0
votes
0answers
32 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 ...
0
votes
1answer
103 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 ...
0
votes
1answer
65 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.
0
votes
0answers
52 views

Fat geometry shader

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. ...
0
votes
0answers
23 views

How does collision detection work? [duplicate]

I was curious on how hit collision works in games. I know there is a simple method that gives every object in a 2D or 3D world a recengular hitbox that makes it easy to detect a collision, but when ...
12
votes
6answers
2k views

What's the fastest way checking if two moving AABBs intersect?

I have two AABBs that are moving, what's the fastest way to check if they will intersect under a frame? By moving I mean not just to check with the usual rectangle intersection method, I mean some ...
5
votes
5answers
3k views

How can I test whether points are within a polygon?

I have 2D-points, which boundaries depict a polygon. The points are at integer positions (no fractions possible). Now I want to build an enumerator in C# that returns all points that are inside the ...
1
vote
3answers
247 views

How do I interpret the dot product of non-normalized vectors?

I know that if you take the dot-product of two normalized vectors, you get the cosine of the angle between them. But if I take the dot-product of two non-normalized vectors (or one normalized, one ...
1
vote
0answers
50 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
1
vote
1answer
53 views

Algorithm that cover one mesh by another mesh

Suppose I have two meshes (Let call me first MeshShirt and second - MeshBody) Meshes are aligned (if i render both MeshShirt "covers" MeshBody). But some parts of the body are not "under" the ...
0
votes
1answer
145 views

Formula to measure uv-mapping distortion

Does anyone know a simple way of calculating (offline) the amount a texture is distorted when mapped to a triangle like the following? Vertex Position UV Coordinates A (Ax, Ay, Az) ...
1
vote
1answer
114 views

Chamfered cube geometry generator

I'm trying to create a geometry generator for a "Chamfered Cube". I've got the vertices working, but I'm stuck with creating the faces. I don't really know how I could re-arrange my algorithm to ...
0
votes
0answers
57 views

Calculation technique for 2D inertia tensors?

Just wondering what the techniques are out there. It's only 2D so I figured there'd be a good chance for there to be a "one size fits all" solution out there that's essentially an analytical solution. ...
0
votes
1answer
141 views

Given seams, how do I unfold a mesh?

If a user marks a seam on a mesh, how do 3D modelling programs (like Blender or Maya) unfold the mesh on to a 2D surface? I can only find papers trying to automate the seaming for you. Given ...
2
votes
1answer
147 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 ...
1
vote
1answer
226 views

How to access Maya Bonus Tools 2012 in Maya 2014

I have been trying to use the paint geometry tool for Maya 2014 but it isnt showing up. I downloaded Bonus Tools 2012 and installed it. Where can I find this tool in Maya 2014?
0
votes
1answer
308 views

How to determine the distance between a point and a rotated rectangle

This question is very similar to How do I calculate distance from a point to a rectangle?. But that question assumes that the rectangle is axis-alligned, or not rotated. So just like in that ...
1
vote
1answer
244 views

In a TPS, how to aim bullets to the direction the camera is pointing, but make the shooting from the player?

(In C#/XNA.) I mean, I can't find an answer nowhere. I'm trying to learn how to make a Third Person Shooter, especially like the one I found in a game called "M.A.R.S.", from Epic Games. I don't want ...
2
votes
1answer
71 views

Distort a quad with a World Matrix

Is it possible to distort a quad multiplying its vertices by a specific world matrix? See the picture to understand what kind of distortion I need: Please note, that the quad is in 3d space and I ...
0
votes
3answers
73 views

Calculating the center of a turning circle

I'm trying to understand how to calculate the midpoint of a turning circle. In the attached picture, my unit is at location U. I want to compute the trajectory of the unit as it turns toward the ...
3
votes
1answer
124 views

How can I animate characters' static-geometry eyes?

Here's a Nintendo example: Specifically, the animation of the pupils seems not to animate the geometry. How is this done?
0
votes
1answer
101 views

How to calculate “real” distance between cursor and away object?

I don't really know how to formulate the title, but the problem is the following: I'm using a scripting language called "SQF" which has been created by a company named "Bohemia Interactive" (no, I do ...
1
vote
1answer
55 views

Rotating a square rendered on a Bitmap

I'm writing a Software Renderer for fun/learning. Basically, it's just a giant array of integers which contain hexadecimal values (representing colour) that are rendered to the screen.... int ...
2
votes
2answers
47 views

Calculating angle a segment forms with a ray

I am given a point C and a ray r starting there. I know the coordinates (xc, yc) of the point C and the angle theta the ray r forms with the horizontal, theta in (-pi, pi]. I am also given another ...
3
votes
2answers
349 views

How to calculate direction from initial point and another point?

I'm making a simple game where I shoot things from a certain point on screen (A). I tap the screen and shoot the projectile from initial point(A) to the tap point(B). But I want the projectile to ...
9
votes
3answers
909 views

How do I translate a spherical coordinate to a Cartesian one?

Could someone point me in the right direction as to how this might be achieved? 3D math / geometry often throws me. I'm looking for something like this (ideally in C#): public Vector3 ...
1
vote
1answer
28 views

Error in plane transformation

I have a bunch of coplanar points, who sit on plane P. I want to translate the plane to Q with the points upon. Here is what I do: I take three points from P, say a, b, c. Their centroid is denoted ...
0
votes
1answer
58 views

Picking a local origin as the centroid of given three points in 3D

Given three points non-collinear P, Q, R in 3D, I need a generic method to generate x', y', z' unit vectors that behave like origin of local coordinate system. x' and y' vectos should be on the plane ...
1
vote
1answer
77 views

How do I combine matrix transformation with non-uniform screen scaling in Flash?

I'm using a Flash transformation matrix for affine transformation. I have a rectangular image being rotated and scaled (in 2D). There are two sets of scaling variables, ScreenScaleX and ScreenScaleY, ...
0
votes
1answer
51 views

Geometry design and buffers

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do: Init: Stock array with positions, array with colors, array with ...
1
vote
2answers
115 views

How to find the points of intersection of two OBBs

In my game I need to be able to find the points of intersection between two OBBs. I'm using Separate Axis Theorem to check if there's an intersection and get the penetration vector if there is one. ...
0
votes
2answers
138 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 ...
3
votes
1answer
421 views

Explain this line segment intersection code

I've been reading this article on pathfinding over polygon meshes using line-of-sight, and in the article are several code snippets. One of them, the one I'm trying to understand, is a simple function ...
3
votes
2answers
256 views

How to make a projectile align correctly with the entity that shot it

I'm developing a 2D game. In the game, all entities can rotate 360 degrees. Each entity holds an angle value, and every frame it is drawn rotated around it's center by it's current angle value. For ...
1
vote
1answer
101 views

XY Location scaling with varying density screens

I have a phone with resolution H=1280,W=720,Density=2 I have a tablet with resolution H=1216,W=800,Density=1.331 I drew a rectangle on my phone with corners Left,Top (-1.6,1.55), Right,Bottom ...