A branch of mathematics concerned with questions of shape, size, relative position of figures, and the properties of space.
2
votes
1answer
121 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
49 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;
...
0
votes
3answers
66 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
865 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
14 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 ...
0
votes
1answer
32 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
24 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
66 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
48 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
75 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
63 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
30 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
63 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
74 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
78 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
111 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
49 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 ...
1
vote
1answer
50 views
How can I fade in 3D foliage smoothly?
Take a look at this picture:
This is a picture of me diving down from a high height. As you can see, the world is a simple world with grass, snow, trees, etc.
The problem here is the 3D foliage. If ...
0
votes
1answer
34 views
How to enforce touching within a ring shape?
I'd like to have the player moving the finger within the shaded ring:
The game should be able to detect "out-of-boundary" events once the finger moves outside the ring. How can I accomplish this?
0
votes
1answer
72 views
What is the Z plane?
I am learning the basics of geometry shaders and I came across references to the "Z plane." It's pretty easy to visualize the X and Y planes, but where does the Z plane reside in Cartesian space? ...
3
votes
1answer
60 views
Vertex normals in the geometry shader using directx
I'm in directx 11 with the geometry shader.
Is is possible to calculate vertex normals? Just one like segment per vertex? In the geometry shader?
I did vertex normals per face, this is what I got,
...
1
vote
0answers
61 views
2d grid vision(eye sensor) for a neural network bot?
I have a 2d grid and neural network bots living above it. What is a good way to give them vision of tiles in front of them?
Below I describe my idea that I don't know how to efficiently(or ...
4
votes
1answer
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 ...
4
votes
2answers
147 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 ...
5
votes
2answers
104 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 ...
0
votes
0answers
37 views
How to generate tangent and binormal(bitangent) of a triangle polygon mesh
I am currently using FBX sdk to acquire mesh information from obj and fbx files. However, not all meshes contain tangent and binormal(bitangent) information so I have to use the method ...
6
votes
0answers
99 views
Dual Contouring - Finding the feature point, normals off
I am following this tutorial to implement Dual Contouring
http://www.sandboxie.com/misc/isosurf/isosurfaces.html
My data source is a grid 16x16x16;
I traverse this grid bottom to top, left to right, ...
2
votes
1answer
44 views
Finding vector from a vertex to a plane
I am trying to implement Dual Contouring, following serveral sources, mainly http://www.sandboxie.com/misc/isosurf/isosurfaces.html
but now I want to implement finding the feature point as explained ...
5
votes
4answers
225 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 ...
5
votes
1answer
137 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 ...
5
votes
2answers
101 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 ...
8
votes
4answers
670 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++?
...
5
votes
2answers
753 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 ...
1
vote
1answer
142 views
Most efficient way to calculate angle between two line-segments that do not necessarily touch each other
Although I found answers on calculating angles from vectors, I didn't find a specific way to calculate angles between line-segments that do not necessarily touch each other (I say "not necessarily ...
2
votes
1answer
87 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 ...
2
votes
2answers
117 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, ...
1
vote
0answers
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, ...
1
vote
0answers
96 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 ...
0
votes
2answers
100 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 ...
1
vote
3answers
132 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 ...
4
votes
2answers
242 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 ...
2
votes
0answers
92 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 ...
0
votes
0answers
28 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 ...
0
votes
0answers
60 views
Project 2d click/touch onto 3d plane
I have a 3d scene that contains an infinite plane that is NOT parallel to the camera (so every screen coordinate corresponds to a point on this plane- in other words, there are no possible invalid ...
9
votes
4answers
224 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 ...
1
vote
1answer
123 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 ...
0
votes
0answers
38 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?
0
votes
0answers
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 ...
0
votes
2answers
123 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);
...
0
votes
0answers
33 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 ...