A branch of mathematics concerned with questions of shape, size, relative position of figures, and the properties of space.
1
vote
1answer
13 views
Problem with Rotating Third Person Radar UE4
I am doodling on the Flying game template on UE4. I am making a 2D radar on top left. Radar's north direction is the pawn's forward direction. So when it approaches to an object with the dotProduct ...
0
votes
2answers
112 views
How can I randomly pick points on a triangle?
Please can help me for a geometry query, I am working out fast mesh to voxel algorithm without using rays and complex maths...
What are the maths to sample N points on a triangle randomly? If you ...
3
votes
1answer
62 views
I'm rotating an object on two axes, so why does it keep twisting around the third axis?
I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can ...
0
votes
1answer
48 views
There any way to insert images inside the code (just for comprehesion) in any IDE compatible with Game Engine Unity3D (Monodevelop for example)? [closed]
My code has a lot of geometry codes, thinks that shouldn't be represented just by comments I don't know if it exists, but should be fine to insert images like png in the middle of codes explaning that ...
0
votes
1answer
29 views
Coordinates of the corners of a rectangle bridging two circles
I am implementing a game that involves slingshots and circular objects. I have gotten the basic "geometric" construction down for rendering the slingshot, but I am having trouble implementing this in ...
0
votes
3answers
60 views
Collision Detection works 2 sides - Minkowski Sum xna
This might be really simple but it is giving me a lot grief and I wondered if you guys would be able to shed some light on it. Basically I have a tile map which draws tiles at 64 * 64 and that works ...
0
votes
0answers
33 views
Reconstructing 3D Rotation from 8 byte - Assistence required
I am currently trying to load 3D models and animations into a program. The file format has no public description, so I am decoding them piece by piece. (I'm studying computer science and it's for ...
0
votes
1answer
61 views
Overlap color between objects
I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
0
votes
2answers
93 views
Determine the z coordinate of a deformed plane based on uv (xy) coordinates
I am using a formula to turn the following texture
into what looks like two 3 dimensional planes
The formula I am using for the texture deformation is
float2 texUV = float2(uv.x / abs(uv.y), (1.0 / ...
0
votes
1answer
42 views
Push cube outside triangle face
I'm creating a 3D game, and I need to know how to push a player (axis aligned box/cube) outside a triangle.
How can I get get the push direction?
0
votes
1answer
61 views
Move object forward according to rotation
How do I make an object (like a bullet) go forward according to its rotation in vanilla nodejs (my game server language)? For example, if an object's rotation is 0 degrees, then it goes straight up.
0
votes
0answers
21 views
FInding out if a shape is enclosed by other shapes
I'm trying to programmatically work out if a 'core' shape is surrounded with other shapes and thus no space exists around it. Here's an illustration of what I mean (ignore white gaps, they are just to ...
1
vote
1answer
103 views
Finding if 2 polygons intersect using clipper library
After realising my code was pretty inefficient at checking for polygon overlaps, I've turned to a mentioned library Clipper but finding it difficult to know hot to use it for this operation.
I am ...
1
vote
1answer
50 views
Finding when shapes overlap and lines intersect but exclude points/edges
I've been looking for a c# algorithm to help determine if shapes and lines intersect but want to exclude boundary overlaps. Here's an example:
My true problem is finding if polygons intersect but ...
8
votes
1answer
143 views
Snapping shapes together in game
I'm trying to work out how to snap shapes together the player may move around on a canvas.
As the square approaches the other object, I want to pull that shape in (given a certain proximity) and have ...
1
vote
1answer
56 views
Points inside a Polygon, failing for shapes with 0,0
I've been using an algorithm (http://wiki.unity3d.com/index.php/PolyContainsPoint) to tell me if a point is inside a polygon... in fact a few variants (here and here) but they all come back the same. ...
1
vote
1answer
84 views
Checking if shapes will tessellate
I'm trying to figure out where to start with getting code together to check if a shape tessellates.
An example:
Consider that the shapes cannot be rotated, just as-is. A 'compound' shape (as seen in ...
2
votes
2answers
66 views
Given a grid system where some coordinates are marked as impassable, how to find natural-looking car driving path between two locations?
I can compute an A* path, but I get only cardinal directions from that. A 45˚ path would look like "up 1 left 1 up 1 left 1 up 1 left 1..."
My specific question is, given a grid with a pathing ...
8
votes
1answer
337 views
Algorithm for “healing” multiple rectangles into a smaller number of rectangles?
Say I have a grid of rectangles of different shapes and colors and I want to reduce (reasonably close to optimal is fine, optimal is not necessary) the number of rectangles to represent the same ...
0
votes
1answer
21 views
Lengthen Line (bidirectional) - crossing zero line
I'm trying to lengthen a line, by a certain amount.
I want to apply the modification to both points on the line, expanding it in both directions. without moving it from it's current position (center ...
1
vote
0answers
24 views
Calculating the inverse mesh of a 2D mesh inside a bounding box
If I have a mesh (drawn in red below)
How can I calculate the inverse of the mesh (drawn in red below), given that the mesh is always constrained by the same four vertices of the encompassing ...
0
votes
0answers
37 views
What shapes interlock solidly like cubes?
What basic geometric shapes, besides cubes, interlock "minecraft" style like cubes?
A small edit to make question more suited to Game Dev:
I am experimenting with game dynamics to create geometric ...
1
vote
1answer
166 views
How to draw an arc between two angles?
I'd like to draw an arc between two specific angles. For example, "draw an angle between 0 and 90 degrees" and it will draw only that part of the circle and ignore the rest.
1
vote
2answers
57 views
Best way to test if some point on a line if in front of another point on the same line in 3D
I have a line in 3D defined by point P0 and direction vector D.
For given input point P on a line defined as above, I want to test if P is in front of point P0. The code will be used in GLSL fragment ...
1
vote
2answers
122 views
Calculate length of isometric line
In my isometric game the user can draw a line of arbitrary length, and I need to calculate the "unprojected length" of the same line. Users can only draw lines in 6 directions (4 isometric directions ...
3
votes
1answer
66 views
Point plotting with a line graph
Please see attached screenshot.
Here's how it works.
A is a slider that goes up and down, and the red line uses the centre point of the A slider to draw its start point.
B is another slider, but ...
2
votes
1answer
36 views
Check if a 3D mesh is a rectangular prism
I have a mesh post-processor in Unity that automatically a convex mesh collider to objects that need one (mostly all).
Sometimes however there are objects that only need a box collider instead.
...
2
votes
0answers
29 views
What is the formula for the collision of two “stretched spheres”?
In Smash Bros Melee, hitboxes aren't perfect spheres or boxes. They are, instead, a shape that looks like a continuous line of consecutive spheres:
I.e., the geometry can represented as:
Hitbox : (...
0
votes
2answers
40 views
rough texturing on edges of mechanical parts
How do major studios fake the effect of "wear & tear" on the edges of guns and other things? I've always wondered this, but today it got to the point where I figured, why not just ask you guys. I"...
0
votes
0answers
29 views
Finding minimum horizontal offset to disjoin two objects in 3D
This is an extension of sorts of the question asked here: Allowing a player to walk up and down slopes without resistance
I am using the Separating Axis Theorem to determine the minimum translation ...
0
votes
1answer
86 views
Applying texture inside of an Icosphere?
I have implemented a code to generate an Icosphere procedurally in Unity 5.3.4f, which works pretty well. However, what I need to do know it tweak the code to make the sphere to receive texture only ...
1
vote
0answers
48 views
HLSL topology mismatch question
I'm trying to write a fur shader with the shells & fins technique. Currently I receive this DirectX error
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The declared input
primitive type in ...
0
votes
1answer
52 views
Draw a square given 2 corners
I am at the moment trying to come up with a simple method to extract some data points, given two corners.
A***************
****************
***************B
I tried to illustrate my situation above.
...
4
votes
1answer
240 views
Could triangles be used for swept-AABB checks between positions?
I'm trying to understand swept-AABB collision detection. When checking for collisions between two positions of an object, I commonly see one of 3 strategies used:
Rays: trace rays from parts of the ...
-3
votes
1answer
87 views
Why do I have to do minus-equals for the x-coordinate but plus-equals for the y-coordinate?
I found a simple script in C# in Unity5 to make the camera follow the mouse:
xRotation -= Input.GetAxis ("Mouse Y") * lookSensitivity;
yRotation += Input.GetAxis ("Mouse X") * lookSensitivity;
...
1
vote
3answers
143 views
LibGDX - Trying to make a radar-like display
i have an interesting question about geometry.
I have two or more moving objects outside of my stage's viewport (blue and red circle in the image below), which i want to point at with two arrows on ...
8
votes
2answers
934 views
Get water flow direction vector from water normal vector
Im stuck developing an important detail of my game water: Making it flow downwards!
Considering a typical 3D world in wich water tends to go towards gravity g=(0,-1,0) , and having the normal of the ...
0
votes
1answer
25 views
How to calculate the magnitude of the drag in Corona-sdk?
I'm making a game on Corona that launches a ball.
The force is based on the magnitude of the drag: the larger is the drag -> the higher is the force.
I'm having some trouble to do this, because I ...
3
votes
1answer
91 views
How to find a point on a plane?
I'm using unreal engine 4. Currently I ray trace to a surface in game and I'm trying to find the location of the point relative to the surface1 instead of the world.
I have the world position of the ...
0
votes
0answers
35 views
How to convert Non-Axis Aligned Bounding Boxes to AABB
I'm trying to write a raytracer to render boxes (cubes) that are arbitrarily rotated, i.e. not necessarily axis aligned. While I'm reasonably comfortable ray-tracing an axis-aligned cube, I don't know ...
0
votes
1answer
85 views
What technique should I use to implement the following type of “diggable” terrain?
I'm trying to replicate a certain game mechanic from the game Diggles.
This game takes place in a vertical cross-section of the earth and allows the player to dig tunnels and caves into the ...
0
votes
1answer
87 views
Normal to an edge of a polygon, from a point inside the polygon
Suppose that I have a closed boundary that is represented by n points. Using these n points I construct a polygon with n sides. I have a point P(x,y) that lays inside the polygon.
I want to draw the ...
1
vote
2answers
165 views
How do I calculate the tangent to a point on a circle?
I have a line that is from the center of a circle to a point on it's edge that is changing constantly (radius is drawn to a point orbiting a circle)
I want to make a line tangential to the circle ...
3
votes
2answers
69 views
Calculate total area of a composition of images
I'm trying to calculate the total area of a game object composed of several images. For each image, I know:
Width, Height
X, Y
Rotation
ScaleX, ScaleY
OriginX, OriginY
Where OriginX/Y are floats ...
0
votes
0answers
35 views
How to find visible planes in a world of boxes
I have a world where each object is a box:
Each box has position x, y=0, z, dimensions width, height, depth. The boxes are never rotated. Each box is composed of 5 planes (left, right, front, back ...
3
votes
1answer
88 views
Super formula on shader
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 ...
1
vote
1answer
135 views
Best way to find line segment intersection
I need to find the point of intersection between two line segments in 2D space. I receive them in terms of both coordinates of both lines. Because they are line segments I would also need to know if ...
-1
votes
2answers
97 views
Help with drawing a polygon with N sides [closed]
I am at university on my games development, and I have been given work to fill in an empty pixel plotter program using the methods they have supplied for it to teach us the algorithms used in 2 ...
0
votes
1answer
188 views
How could we use trigonometry for moving around a 3D World?
Well I have a question about geometry and 3-Dimensional player movement in general. I'm using Java, OpenGL and LWJGL.
This is basically what I got:
currentFrontSpeed: Is a float that contains the ...
1
vote
1answer
51 views
What is the best way to check for intersection of two bounding boxes, given a minimum and maximum Vector3 for each one
I have a BoundingBox object which holds two Vector3's (x, y, z), one for the minimum point and one for the maximum point. (-1.5 0 9 | 1.5 3 10)
What is the best way to check for any intersection or ...