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
0answers
15 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
20 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
67 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
33 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: ...
1
vote
1answer
37 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
55 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?
3
votes
1answer
110 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 ...
1
vote
1answer
25 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
55 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
44 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
52 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
43 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
55 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
53 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
33 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
37 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
61 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
30 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
72 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
17 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
78 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
60 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
33 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
65 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
30 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
38 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
80 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
186 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
72 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 ...
0
votes
0answers
44 views

Setting object O2 to have the same geometric relation to P2 as O1 has to P1

I'm trying to place Object O2 with the same relation to P2 that O1 has to P1, like shown in the picture below. This is a problem that I'm facing trying to implement portals in Unreal Engine 4, where: ...
4
votes
1answer
211 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
219 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
42 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
88 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
145 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
66 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
121 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
56 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
vote
2answers
151 views

Finding the line segments where 2 polygons share an edge

I am working on code to place doors between rooms on my levels. Rooms are lists of points which make up a polygon. In order to find a place for a door between two rooms, I need to find what line ...
0
votes
1answer
35 views

Algoritm for scaling an 3D model with fixed edges

I am looking for an algorithm that allows me to scale a 3D model with certain fixed edges. For example scaling up a window should have the frame remain a fixed width while the length of the frame ...
0
votes
2answers
82 views

Finding Endpoint of line in Unity

I have a startpoint, magnitude(length) and direction and want to find endpoint to construct the line here is the code to make question more clear ...
1
vote
1answer
49 views

Unprojeting a line on the screen

I have a line connecting two points of my model. I see a projection of this line on my screen and a want to map a point of that projection to the corresponding point in my model PoV. Let ...
0
votes
1answer
71 views

Figuring out the exponent in a spotlight equation from the angle of a cone

I followed a tutorial on how to build a spotlight using DirectX. This tutorial uses a point light equation plus a line of code to limit the light to the shape of a cone. I have everything working, but ...
-1
votes
1answer
52 views

How to properly space train bogies

I have a small project with a train that follows a track, composed of discrete pieces. For each piece I calculate the location based on distance traveled, and each carriage gets a fixed offset. I ...
1
vote
2answers
214 views

How to calculate plane corner vertices from plane origin point and plane normal?

I have an origin point, and normal vector of a 3D plane. I want to calculate 4 vertices to use as the corners of a 2 triangle quad to render the plane.
0
votes
0answers
56 views

Tube model imported from Blender getting stretched vertically when rendering

I'm actually working on a 3D game engine with OpenGL 4 and C++. The problem is that, I don't know why, my geometry isn't well renderered except for primitives. At the right you can see a cube, it is ...
0
votes
0answers
96 views

Pong paddle and deflection angles

I'm trying to make a pong clone and am having trouble grasping ball deflection. The way I'm approaching it is to increase the angle by how far the ball collides from the middle of the paddle. However, ...
0
votes
1answer
79 views

Finding rotation quaternion from orthonormal basis?

Given three 3D unit vectors \$a\$, \$b\$, \$c\$ such that: \$a \times b = c\$ \$b \times c = a\$ \$c \times a = b\$ (ie \$a, b, c\$ form an orthonormal basis) How do we calculate a unit ...
1
vote
0answers
35 views

Tilemap Collision Generation - Tracing Polygons with Slopes

I've been using Godot for my game, but it has a unfortunate quirks with tilemap collision where physics objects can bounce weirdly near tile seams and kinematic bodies can often get stuck in seams as ...

1
2 3 4 5
10