Questions tagged [geometry]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
46 views

How do I get the consistent time it would take for two points to reach each other in circular motion?

I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
1
vote
1answer
61 views

Optimal way to find the closest entity to player with a restricted set of functions

The scripting engine of Skyrim (and Fallout 4) has an interesting function called FindClosestActor(x,y,z,radius). If you call it with x,y,z center coordinates and a radius, it returns the closest ...
0
votes
0answers
21 views

Program doesn't detect a ray triangle intersection correctly

Every frame I check if a ray intersects a triangle. But in practice program tell me that triangle is intersected only when I move camera on to it's position. I don't even have to put cursor on a ...
1
vote
1answer
52 views
0
votes
1answer
69 views

Extracting cell center and corner points from rasterized Voronoi diagram

I currently have this code which I copied from Rosetta code: ...
0
votes
1answer
74 views

Deriving shadow position from a 2D heightmap

I have a 2D heightmap with discrete values. Based on these values they should cast a fixed position shadow (constant angle respective to the "sun"). I can figure out how to cast it on a flat ...
1
vote
0answers
44 views

How to project 3D meshes onto a 2D plane producing a 2D polygon silhouette?

I would like to project a number of separate 3D meshes onto a 2D plane and create a 2D polygon representing the outline of all the meshes. I would also like to to create multiple 2D polygons if the ...
0
votes
1answer
32 views

Arranging points in a 2D grid so that successively added points approximate a square shape

So, I ran into a problem with placing points in a grid while always trying to fit them into a square. Here are some examples (the numbers represent the order of placement): Placing 1 point: ...
0
votes
0answers
12 views

How to find the center of mass from CapsuleCast in unity

Is there an easy way to find the center of mass from a CapsuleCast, or should I find the geometric center of it?
2
votes
0answers
71 views

Approximate doom/heretic-style freelook distortion with modern graphics APIs

Currently working on a doom-like engine with fewer technical limitations, and looking into rendering techniques. I'm aware doom's a raycaster, and I want to capture a similar look but with modern ...
0
votes
1answer
42 views

How do I find the correct vectors perpendicular to a vector in between two vertices?

I'm trying to push the purple vertices inward by moving it with a vector perpendicular to the red vector shown in the picture. Each directional vector created will move its respective vertex towards ...
1
vote
1answer
43 views

How can I remove unnecessary vertices from wall edges?

I've got a pretty simple tile based 2d top-down map with an array of walls. In order to figure where to cast light and shadows, I've generated an array of vertex coordinates along the walls like so: ...
1
vote
0answers
22 views

How can I draw a partial circle with LineRenderer?

I'm using the following code, which I found online, to draw a circle with a predefined radius centred on a predefined point in LineRenderer (2D game). ...
0
votes
0answers
24 views

Rotating two types of cubes -- one cube's sides disappear

I had a cube that had 8 vertices and 12 triangles and the visibility of the cube was okay. When I rotated, I was able to see all visible sides of it. Here is my old cube: ...
0
votes
1answer
108 views

Writing a sphere-sphere intersection function

I am writing a function where I have two 3d points with coordinates {x, y, z} both with a line segment of a given length. I am trying to find a common endpoint between the two line segments closest to ...
0
votes
0answers
44 views

Dual Contouring - Eliminating sharp edges

I want to remove the sharp edges (Cubic looks) of Dual contouring. It currently looks like this: This is what I get when I try to implement QEF: ...
0
votes
1answer
44 views

Movement within a circle, but the circle bends around obstacles?

I wish I knew a better way to phrase this, but I want to make an object move from point to point inside a circle. But I also want that "circle" to bend around obstacles, so that no matter ...
0
votes
2answers
59 views

Placing a circle as close as possible to a specific coordinate without overlapping another circle

I am working on a 2D game in Java. My goal is to place a ball as close as possible to the center without overlapping the balls that are already there. How can this be done?
2
votes
1answer
143 views

Formula for attack range using hexagons

I need a little help with a formula to calculate the attack range for my turn-based strat game. Since it's a hexagon grid, I'm having trouble coming up with a formula that would pick the character ...
0
votes
1answer
31 views

How to check if a point is on the plane given bottom-right point, top-left point, normal and the quaternion rotation of the plane

I know the world positions of A and B. We are also given the vector normal and the quaternion rotation of the plane How do I check if a point lies on the plane?
1
vote
1answer
183 views

Getting the point of intersection from this fast ray box intersection algorithm

I have seen lots of such algorithms that return a Boolean value, but I also need to get back the intersection point and ray length. I am looking into this example, but I'm not sure how I can extract ...
0
votes
0answers
51 views

Clipping walls in Doom-style FPS view

I have two points representing a line, and a player position. I translated and rotated the points around the player, and this works just fine. Next I want to clip the resulting line like Bisqwit did ...
-1
votes
1answer
55 views

What is the relationship between gimbals and Euler angles?

Through reading a lot of articles, I understand what gimbals are (at least I think so). And I know that Euler angles follow the rules of gimbals, but why? Why do Euler angles comply with the rules of ...
0
votes
1answer
48 views

How to handle movements of objects in a platformer with a cylindrical map?

I was wondering what would be the best approach for a game with a perspective like Resogun, where the world wraps around in a cylinder: In my opinion, the easiest approach is to: have a "...
0
votes
1answer
70 views

How can I implement an aiming system like the Tank Stars mobile game?

I have been trying to implement the same aiming system as in Tank Stars, but I got a little stuck. I implemented simple stick aiming, which basically aims towards the stick movement. In Tank Stars, ...
1
vote
1answer
123 views

Seam on UV Sphere

I created a uv sphere model in Blender, and I'm loading it as an obj into my OpenGL game. I'm attempting to model a 2d image as a texture for this sphere to make the moon, but I've run into this issue....
0
votes
0answers
43 views

Check if a triangle is back-facing in a 3d model

I'm creating 3d models with an algorithm, but i have no idea how to make all triangles in the mesh face the right direction, so some faces are facing inside the model. The list of vertices is sorted ...
1
vote
0answers
48 views

How can I reduce a frustum to the subset that passes through a portal AABB?

I'm trying to implement portal based occlusion culling: There are sectors and portals. When a portal is visible, the sector it is connected to is rendered. The sector is made of polygons and ...
0
votes
1answer
66 views

How much is 2D geometry used in 3D? [closed]

I'm studying 2D geometry with eventual goal to study 3D geometry for building games - very much looking forward to 3D!! Looking up on how to calculate hypotenuse of a right triangle in 3D I read that ...
0
votes
1answer
33 views

Can you help me resolve a bug in mesh collision code?

I have entities which walk along a 3D mesh. I move the units along their x,z axis, and every frame I update their y-position according to the quad or triangle they are standing on, using Barycentric ...
0
votes
1answer
83 views

finding the angle of rotation of a 3d line

I have a line segment joining two 3D points AB, and a vector V which is normal to it. I need to know the angle of AB in the plane described with V as the plane normal, that is: in the plane of the two ...
0
votes
0answers
20 views

Closest circle intersection within a triangle

(Context: I use a Delaunay triangulation for pathfinding, and have circular points of interest, of varying sizes, being randomly placed around the map. Units need to be able to determine the closest ...
0
votes
2answers
135 views

Generate vertices of a sphere by using spherical coordinates

I'm trying to generate points for a sphere by subdividing the space of spherical coordinate in res sector and res slices. At first I did my own implementation, but it wasn't working. After a while I ...
1
vote
1answer
95 views

Find projecting triangle for UV mapping in RuneScape model format

I am using an old Runescape model format, also used by Thief and Quake. In this format, instead of specifying UV coordinates for each vertex ABC, we specify a second trio of vertices PMN. Those ...
0
votes
0answers
38 views

What is the math to project a 3D object's center onto a 2D plane?

What I really need is the x,y of the object when it is outside of the screen: I'm actually coding a UI in Objective-C, not a game. In this different kind of UI you navigate a 3D space with objects. ...
0
votes
0answers
23 views

Is there a way to invert the scaling of the axis and keep the orthogonality?

Recently I ask question and since then been decide to find solution by dividing scale matrix to two part GlobalScale and ...
0
votes
1answer
184 views

Creating Sphere Triangles from Vertices

I came across a way to create the vertices of a sphere, located here: https://gamedev.stackexchange.com/a/150293/62793 I converted this to the following C# example: ...
0
votes
1answer
33 views

Make Minecraft Main Menu Camera movement

I intend to make exactly like this. I highly suggest you watch just 5 seconds of the video because it already explains what I intend to do. I've been trying cosine and sine on vector3s but I can't ...
0
votes
1answer
44 views

Contact friction for overlapping rectangles

I am currently developing a top-down "tabletop simulator" where you are able to drag, drop and rotate playing cards on a table. The cards are able to overlap but do not interact as of yet. ...
1
vote
1answer
86 views

How to avoid destroying information when scaling

I'm in the progress of making a simple 3D editor, just for developing skills on 3d graphics. After implementing some basic tools, I realize that scaling isn't working as I expected. For example, when ...
2
votes
2answers
238 views

Finding the position of a point inside a triangle, based on the position of a point in another triangle (barycentric coordinates in Godot)

I'm trying to translate a UV coordinate into a world coordinate. (this is not in a shader, it's in GDScript in Godot, to bake out a texture based on some raycasts). So I find out which triangle in the ...
1
vote
1answer
123 views

How do I scale my spell target indicator to match the radius of OverlapSphere

I have a spell system in which some spells have an Area of Effect. To get the targets I use Physics.OverlapSphere. I show the player an indication of the spell's ...
4
votes
1answer
308 views

space map generation

I am at the beginning of the creation of a space 4x and first of all i need to generate a galaxy of stars linked by connecting lines that changes in each new game, I'll add a few pictures to show what ...
0
votes
1answer
303 views

Getting points inside a circle with a given radius in a 2D array?

Let's say you have a system that removes everything within a square made up of 4 position points. This square is calculated by taking the center point and adding or subtracting the range from this ...
1
vote
1answer
44 views

Determining bordering irregular shapes from an image

Given only an image, I have to find a way of determining whether any two irregular bodies in that image are bordering one another. This is a map of districts, each with their own name, and my goal is ...
1
vote
1answer
104 views

Moving and shrinking circle to a circle inside of it (PUBG like zone)

I am trying to create a battle royale circle gamemode within Arma3 that would work like in PUBG. For anyone who doesn't know how it looks like: Red circle should smoothly shrink into the blue one (...
0
votes
1answer
202 views

Approximately circular range of motion on a square tile grid

I've been working on a grid based tactics style game to learn the ropes of Unity. I have an issue with movement range for a player unit. Let's say the units move range is 3 spaces.. If I set up each ...
1
vote
1answer
80 views

Finding equivalent axial coordinates for a wrapping hexagonal map of radius n

I'm creating a wrap around hexagonal map that will potentially render infinatly. With the method I'm using, I have an x-y coordinate I use to find it's equivalent axial coordinate with the equations:...
0
votes
0answers
220 views

Intersection of ray and non-axis-aligned box

I need to compute the intersection of a ray with a non-axis aligned box. Currently, I transform the ray into the local space of the box, do classic ray-AABB intersection and transform the intersection ...
1
vote
2answers
71 views

Get vertices of a terrain mesh affected by a brush or placement shape

I have the following mesh, it has very simple structure. You can think of it as a terrain from top-down view: each vertex (red and numbered) is a fixed distance away from its four neighbours in the ...

1
2 3 4 5
10