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

learn more… | top users | synonyms

1
vote
0answers
17 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
23 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
19 views

Rotating a UI arrow according to the change in camera's rotation

I have been trying different alternatives to do what is a very basic thing but I couldn't have any success. What I want to do is this. I have a 2D UI sprite at the screen, formed by 2 triangles, with ...
0
votes
0answers
25 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
28 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
20 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
47 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....
2
votes
1answer
131 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
51 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
81 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
878 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
15 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
37 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
28 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
70 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
58 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
85 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
64 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
31 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
65 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
88 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
81 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
123 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
50 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
53 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
36 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
84 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
72 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
69 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
186 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%...
5
votes
2answers
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 ...
0
votes
0answers
45 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 ...
7
votes
0answers
117 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
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 ...
5
votes
1answer
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 ...
5
votes
2answers
106 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...",...
8
votes
4answers
755 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
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/...
1
vote
1answer
170 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
107 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
124 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
129 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
105 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
137 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
370 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
99 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
30 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 ...