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

learn more… | top users | synonyms

5
votes
1answer
136 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 ...
1
vote
2answers
2k views

Rotate an object given only by its points?

I was recently writing a simple 3D maze FPP game. Once I was done fiddling with planes in OpenGL, I wanted to add support for importing Blender objects. The approach I used was triangulization of the ...
2
votes
1answer
161 views

Finding the normals of an oriented bounding box?

Here is my problem. I'm working on the physics for my 2D game. All objects are oriented bounding boxes (OBB) based on the separate axis theorem. In order to do collision resolution, I need to be ...
18
votes
5answers
717 views

Moving CW or CCW?

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 ...
0
votes
1answer
1k views

“LNK2001: unresolved external symbol” when trying to build my program

I get the following error(s) on my program that captures the mouse and then draws a line. Errors: 1>------ Build started: Project: Capture_Mouse_Line, Configuration: Debug Win32 ------ 1> ...
11
votes
2answers
2k views

Arbitrary Rotation about a Sphere

I'm coding a mechanic which allows a user to move around the surface of a sphere. The position on the sphere is currently stored as theta and phi, where theta is the angle between the z-axis and the ...
10
votes
2answers
634 views

How to limit click'n'drag movement to an area?

I apologize for the somewhat generic title. I'm really don't have much clue about how to accomplish what I'm trying to do, which is making it harder even to research a possible solution. I'm trying ...
1
vote
2answers
115 views

ricocheting off a wall

I have a capsule (sphere sweep) that I've computed the collision on a mesh with. I know the point of impact and normal of the face it collides with. My moving object - I'm using a capsule to ...
1
vote
2answers
1k views

Wrong faces culled in OpenGL when drawing a rectangular prism

I'm trying to learn opengl. I did some code for building a rectangular prism. I don't want to draw back faces so I used glCullFace(GL_BACK), glEnable(GL_CULL_FACE);. But I keep getting back faces also ...
5
votes
4answers
276 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: ...
11
votes
3answers
600 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?
4
votes
3answers
328 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 ...
1
vote
1answer
110 views

Intersection of player and mesh

I have a 3D scene, and a player that can move about in it. In a time-step the player can move from point A to point B. The player should follow the terrain height but slow going up cliffs and then ...
0
votes
1answer
158 views

moving in the wrong direction

Solution: To move a unit forward: forward = Quaternion(0,0,0,1) rotation.normalize() # ocassionally ... pos += ((rotation * forward) * rotation.conjugated()).xyz().normalized() * speed I think the ...
0
votes
1answer
55 views

applying rotation and speed to move user

My player has a position (vec3), rotation (quaternion) and speed. I have a fixed time step. At each tick, I work out from key-state etc what rotation and speed adjustments to make. How do I now ...
1
vote
2answers
164 views

The distance to a line from a point, find the constant values?

I have 3 points, (x1, y1), (x2, y2), (x3, y3) I should find the AH height. For this i must use: How can i find each "a", "b" and "c" values?
3
votes
3answers
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 ...
14
votes
4answers
582 views

Algorithm for creating adjacent triangles

I have a system where you can click once to place a node in a scene. When you place 3 nodes, it forms a triangle. When you place any future nodes, it creates a new triangle by joining that node to the ...
4
votes
2answers
428 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 ...
1
vote
2answers
364 views

Separation of axis theorem implementation

I have been following the this guide to implement this. My current implementation is the following: class SAT { SAT(); bool collides(Rectangle rect1, Rectangle rect2){ var axises = [ ...
6
votes
2answers
381 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 ...
3
votes
3answers
411 views

Adding tolerance to a point in polygon test

I've been using this method which was taken from Game Coding Complete to detect whether a point is inside of a polygon. It works in almost every case, but is failing on a few edge cases, and I can't ...
8
votes
2answers
2k views

How do I determine if one polygon completely contains another?

I have 2 polygons. I know the vertex coordinates of both polygons. What's the best way to check if one is completely inside the other? For example, the algorithm should only recognize the black ...
0
votes
1answer
886 views

Determining and culling non-visible vertices

Ahoy! After posting my previous question on tile maps, i've been tinkering with an implementation i'm rather pleased with so far but would like to gather some more information about submitting ...
1
vote
2answers
1k views

Render a polyline with rounded joints

I have a list of points (3D) and want to draw a line connecting all points with a specified width. The line should be rendered in OpenGL (using OSG) as triangles. The real challenge of this task is to ...
0
votes
2answers
494 views

ray polygon intersection

Hi, I am looking for an elegant way to do ray and polygon intersections in 2d. I don't care about languages. Now what I'm doing is taking a line that lies on the ray (with a screen length) and ...
0
votes
1answer
596 views

Easy way to project point onto triangle (or plane)

I have a mesh of triangles (navigation mesh), and a point in 3d space. This point should be "over" one of the triangles all the times. I'm trying to determine which triangle is the one the point is ...
0
votes
1answer
198 views

Minimap Around Perimeter of Screen, Code Provided

What I'm essentially trying to do is what a lot of FPS's nowadays do in regards to their HUD. When an objective is off-screen, a small icon / symbol is shown on the perimeter of the screen, basically ...
6
votes
3answers
3k views

2D isometric: screen to tile coordinates

I'm writing an isometric 2D game and I'm having difficulty figuring precisely on which tile the cursor is. Here's a drawing: where xs and ys are screen coordinates (pixels), xt and yt are tile ...
7
votes
2answers
166 views

Intersect of vector and triangle side

I'm trying to create a triangular touch surface for iOS where the user can drag around a point inside this triangle. Using information from this page, it is easy to figure out if the dragged point is ...
1
vote
2answers
812 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 the segment and the cylinder? The segment is defined by ...
4
votes
2answers
774 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 ...
4
votes
2answers
397 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 ...
5
votes
1answer
845 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 ...
2
votes
1answer
413 views

How do I make a low pass filter (average of readings over time) for compass?

I'm making a prototype for android that pulls compass data from the phone. I want to stabilize it so it is less jerky, by taking the average of the last couple of readings. I have done this for ...
0
votes
1answer
442 views

Calculate path of laser beam?

Lets say we have a laser beam emitter that has a position and an angle (in a 2D world to simplify things). The laser emitted from that emitter will start at that position, and continue heading in the ...
2
votes
1answer
335 views

High school-level geometry book focusing on game dev for struggling student?

Here's the situation. My brother, a freshman in high school, isn't doing too well in geometry. Partially because he doesn't do half the work, but partially because he seems to have genuine ...
1
vote
6answers
484 views

Testing whether two cubes are touching in space

Does anyone have any clean ideas on testing whether two cubes in 3D space touch? By touch I mean, touch at corners or on a face or on an edge. Say that the cubes are axis aligned and there is no ...
0
votes
2answers
302 views

Partial recalculation of visibility on a 2D uniform grid

Problem Imagine that we have a 2D uniform grid of dimensions N x N. For this grid we have also pre-computed a visibility look-up table, e.g. with DDA, which answers the boolean query is cell X visible ...
4
votes
1answer
354 views

Running geometry shader only once

(Unfortunately couldn't find the answer myself) Does a neat way to cache the geometry shader results in Direct3D10 or OpenGL exist? (preferably Direct3D10). I'm building my geometry based on texture ...
27
votes
4answers
2k views

Why does my object move faster at 45 degrees than at 90 degrees?

I have objects in my game that move faster at 45 degrees then at 90 degrees. Each object has Point (x,y) position Vector2D (x,y) direction Int speed And what I do during a update is that new ...
4
votes
2answers
1k views

What is a good way to determine if a vector is between two other vectors?

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, ...
1
vote
1answer
320 views

How do I determine if a tile is a slope based on the tile image?

In my game, every tile is a 32x32 texture. All the slopes are a 0 - 45 degree angle. I would like to determine, at the time I load the tile, if the is sloped by examining its texture/bitmap data. How ...
6
votes
2answers
196 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 ...
0
votes
0answers
93 views

Drawbacks for using only quads for model geometry [duplicate]

Possible Duplicate: Why do game engines convert models to triangles compared to keeping it as four side polygon What are the main drawbacks for using "only" quads for model geometry? Does ...
3
votes
1answer
1k 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 ...
14
votes
3answers
531 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?
9
votes
2answers
307 views

How do you calculate if 2 lines are facing toward or away?

Given the 4 points describing 2 line segments, how do you calculate if line A is towards or away from line B? The 2 lines have a fixed length, and can be measured as distance from x1/y1 to x2/y2.
2
votes
2answers
1k views

How can I transform a point from world space to object space?

If I have an object space described by transformation matrix that should be applied to object to transform it to world space, what I have to do to transform point (world space) to that object space. ...
0
votes
2answers
536 views

Ways to define a curve

I'm trying to give shapes in my physics engine roundness/ curvature. I am aware of various methods for mathematically defining curves; such as bezier-cruves, ellipses, etc. However I am not sure ...