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
2answers
50 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 ...
0
votes
4answers
2k views

How does atan2 work when getting angle of a vector?

I know that atan2 gives me the absolute angle of any vector. But it doesn't give a value from 0 to 360 degrees. Instead, it gives a value (if I'm not mistaken), between 0 and 180, or between 0 and -...
2
votes
1answer
143 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 ...
1
vote
3answers
99 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 ...
3
votes
1answer
50 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 ...
1
vote
1answer
42 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 ...
2
votes
1answer
26 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. ...
-4
votes
0answers
50 views

Isometric social games. Click to tile

In the Social Isometric Games book, page 53, there is a description of the method, that defines a title using mouse cursor coordinates. It works well, but it is not clear what principles are used to ...
0
votes
1answer
19 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 ...
2
votes
0answers
23 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
27 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
20 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
35 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 ...
4
votes
1answer
502 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 ...
1
vote
0answers
26 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
48 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....
12
votes
2answers
6k views

How can I project a 3D point onto a 3D line?

Let's say I have a line defined by two points, A and B, both in the form (x, y, z). These points represent a line in 3D space. I also have a point P, defined in the same format, that isn't on the ...
-3
votes
1answer
56 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
1answer
201 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 ...
5
votes
2answers
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 ...
8
votes
2answers
889 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 ...
1
vote
2answers
92 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 ...
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 ...
3
votes
1answer
86 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, ...
0
votes
1answer
73 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 ...
9
votes
2answers
4k 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
62 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
1answer
96 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 ...
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
33 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
69 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
votes
2answers
83 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
133 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 ...
7
votes
3answers
3k views

Moving a particle around an Archimedean spiral at a constant speed

I want to move a particle in a spiral at a constant speed. Note that that is not a constant angular speed. This is proving rather difficult, and I'll go through my method so far below. The spiral in ...
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
88 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? ...
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
59 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 ...
1
vote
0answers
79 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 ...
0
votes
0answers
71 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 ...
4
votes
2answers
236 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
118 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
51 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 ...
1
vote
2answers
10k views

How do I add an image inside a rectangle or a circle in JavaFX?

Suppose we have a rectangle called r Rectangle r = new Rectangle(40, 20); and an image called image Image image = new Image("...src for image"); How do I fit the image inside the rectangle? Also,...
5
votes
4answers
237 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 ...
9
votes
0answers
135 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, ...
3
votes
1answer
48 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
2answers
114 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...",...