# Tagged Questions

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

569 views

### Robust line of sight test on the inside of a polygon with tolerance

Foreword This is a followup to this question and the main problem I'm trying to solve. My current solution is an hack which involves inflating the polygon, and doing most calculations on the inflated ...
239 views

### How do you calculate if a line is facing a curve?

Given the 2 points describing a line segment, and the 3 points describing a quadratic bezier curve, how do you calculate if the line is facing towards or away from the curve? The line has a fixed ...
6k views

### How do I use the dot product to get an angle between two vectors?

I am learning to use normalized vectors in my games. I've learned that in order to know the angle between two vectors, I can use the dot product. This gives me a value between -1 and 1, where 1 ...
5k 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 ...
314 views

### Would like some help in understanding rendering geometry vs textures

So I was just pondering whether it is more taxing on the GPU to render geometry or a texture. What I'm trying to see is whether there is a huge difference in rendering two scenes with the same setup: ...
766 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/...
233 views

### Creating force shields: the most efficient way of deforming/reshaping a simpler convex mesh so it envelopes a complex mesh?

So, the best way I can think of how to explain what I need is the following (images used here are just random images found trough google image search). What I am trying to create during run-time is ...
3k views

### Morph a sphere to a cube and a cube to a sphere with GLSL

I'm getting started with GLSL with quartz composer. I have a patch with a particle system in which each particle is mapped into a sphere with a blend value. With blend=0 particles are in random ...
4k views

### How do I find rotation in 3D based on a vector/normal?

I've been playing with Blender and Python, doing basic things like accessing vertices/normals,etc. I can get the normal of each face of a mesh. I was wondering, how can I get the rotation of a face ...
168 views

### trapped inside a Graph : Find paths along edges that do not cross any edges

This is a graph based platformer level and the round shapes are creatures. I am looking for a path traveling along edges that does not cross other edges(To simulate the creature crawling on the ...
1k views

### How to perform simple collision detection?

Imagine two squares sitting side by side, both level with the ground like so: A simple way to detect if one is hitting the other is to compare the location of each side. They are touching if all of ...
1k views

### Generating geometry when using VBO

Currently I am working on a project in which I generate geometry based on the players movement. A glorified very long trail, composed of quads. I am doing this by storing a STD::Vector, and removing ...
113 views

### List cells in a 2D grid that belong in a sector / portion of a circle

Are there any algorithms to find out which cells in a 2D grid lie inside/is part of a slice of a circle - a pie slice shaped region? Essentially, as per image below, I need to list out all the green ...
108 views

### How to find out the vertices of the polyhedron formed by the overlapping area of two rotated boxes?

What is the most efficient way for finding out the vertices of the polyhedron formed by the overlapping area of two rotated 3D boxes? If it is still confusing what I mean by "polyhedron formed by...",...
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, ...
287 views

### A* search in hexagonal grid with minimum turn radius

I need to run an A* search through a hexagonal grid. However, I have one nasty constraint: my vehicle can only turn so sharp. It has a specified minimum turn radius. I can't quite see how to translate ...
146 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 ...
1k views

### Repairing back-facing triangles without user input

My 3D application works with user-imported 3D models. Frequently, those models have a few vertices facing into the wrong direction. (For example, there is a 3D roof and a few triangles of that roof ...
571 views

### a flexible data structure for geometries

What data structure would you use to represent meshes that are to be altered (e.g. adding or removing new faces, vertices and edges), and that have to be "studied" in different ways (e.g. finding all ...
5k views

### How can I draw a quad in wireframe with modern OpenGL, without rendering the interior bisecting edge?

I want to draw a quad (not two triangles). I actually know that triangles are faster, as I answered this question. But let's say I am building a 3D modeling tool. It makes sense to draw a quad for ...
673 views

### Allowing a player to walk up and down slopes without resistance

I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them ...
426 views

### How to get distance from point to line with distinction between side of line?

I'm making a 2d racing game. I'm taking the nice standard approach of having a set of points defining the center of the track and detecting whether the car is off the track by detecting its distance ...
190 views

### Generate Geodesic Sphere from Hex and Pentagons

I have two polygonal meshes, a hexagon and a pentagon (They are tiles in a strategy game). I want to use them to construct a geodesic sphere (https://upload.wikimedia.org/wikipedia/commons/e/e7/G%C3%...
154 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 ...
4k views

### Displaying (3D) objects' name above them

The Elder Scrolls: Morrowind has a rather interesting way to display each focused objects' name. It's all a bit fuzzy in my memory right now, but the most important part I remember perfectly: the ...
555 views

### rotating an object from sourceAngle to destAngle, both 0-359, clockwise or counter clockwise?

I've got a game object i need to rotate. It's current angle is player.rotation, the destination is targetAngle, both in degress, 0 to 359. I've got a function named rotateDirection(float sourceAngle, ...
65 views

### What is the fastest way of drawing simple, textured geomtries and keeping the depth test?

I'm looking for a fast way to draw simple 3D geometries - that will consist of up to 10 vertices. Each of them will have a texture (though varying between geometries). I also want to store the ...
518 views

### Geometry vs sprites

I'm developing an android game, where the enemies are geometrical shapes. Performance is a main goal for me so I was wondering if defining shapes directly in OpenGL would be more efficient than using ...
1k views

### scanline filling a trapezoid

I have computed the four corners of the viewable bit of 2d map in my 3d view. So I know the trapezoid that is visible, and I want to 'visit' these tiles in my map. So my algorithm is basically a ...
2k views

### Point line collision reaction

I am trying to program point line segment collision detection and reaction. I am doing this for fun and to learn. The point moves (it has a velocity, and can be controlled by the user), whilst the ...
389 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 ...
472 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 ...
568 views

### Intersection points of plane set forming convex hull

Mostly looking for a nudge in the right direction here. Given a set of planes (defined as a normal and distance from origin) that form a convex hull, I would like to find the intersection points that ...
611 views

### OpenGL, Offset and Camera Space

I was reading chapter 4 of the Arcsyntesis OpenGL tutorial when I came across this line in the GLSL shader. vec4 cameraPos = position + vec4(offset.x, offset.y, 0.0, 0.0); About it, the tutorial ...
388 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 ...
2k views

### Sphere-Sphere intersection and Circle-Sphere intersection

I have code for circle-circle intersection. But I need to expand it to 3-D. How do I calculate: Radius and center of the intersection circle of two spheres Points of the intersection of a sphere ...
300 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 ...
1k views

### Textureing subdivided Icosahedron in XNA, seam problem

*Look below for the updated source code* I have started to to make some different types of objects and create them by code in XNA. Right now I have finished the code for creating a Icosahedron. And ...
3k views

### Decomposing a concave mesh into a set of convex meshes

I'd like to be able to decompose a concave mesh into a set of convex meshes for 2 reasons: Transparent rendering Physics shapes Is there an algorithm that takes a set of triangles (concave) as ...
2k 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 ...
189 views

### What kind of projection is ScreenX=X/Z, ScreenY=Y/Z?

I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library. To project a single vector (X,Y,Z) ...
351 views

### Find the next cell in a grid from a point and direction

I'm trying to solve a very simple problem but I'm unable to come-up with an efficient solution so far. What I'm really trying to do is voxelize triangles in a three dimensional environment but I'll ...
449 views

### Throwing a ball and estimating its path using a Physics engine

The problem: A player entity wishes to throw a ball from a known position with a known initial velocity. The surrounding environment contains physical objects that can alter the trajectory of the ball....
233 views

### Vertices shaking with large camera position values

Basicly when i set the position of my camera (my character in game) to a high value, the geometries seems to be shaking, the higher the position value, the more they shake. On low position values you ...
540 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 ...
2k views

### Generating spherical world from heightmapped terrain

I am using a standard heightmapped procedural terrain in my project. However, I want the terrain to appear spherical when the user zooms out. This is an attempt to simulate the appearance of a ...
65 views

I'm using Shader-toy to experiment and try to learn a bit the shader science. As exercise I wan to replicate some of the wikipedia math plots. I've started with a Super Formula. What I want to ...
880 views

### How do I render a filled and stroked path using OpenGL?

I want to render a 2-dimensional geometric path consisting of Bézier curves and straight lines. Paths can be concave. What is the most efficient way to draw this using modern OpenGL? Can I do this ...