Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
0
votes
1answer
54 views

how can I transform a skewed line to a vertical line?

So, I have a line: And I skewed it with x += y * cos(angle) and got something like: My question is, if I have another line segment with that same skew, how can I ...
0
votes
1answer
30 views

Calcluate Mesh top, bottom, left and right position relative to mouse click position on the mesh

I have a mesh (suppose it can be circle, or rectangular,square or an arc). The geometry of the mesh can be anything. I can click on mesh at any position. From relative to the clicked position, I want ...
6
votes
1answer
57 views

How to “aim ahead of” an object moving in a circle? [duplicate]

Let's say I have a GameObject A that's moving in a circular path in orbit around a central point, and I have a second GameObject ...
1
vote
3answers
50 views

How to find perpendicular line given a line?

I have two points that form 1 line. I want to find a point that creates a perpendicular line. Here is an image showing what I am looking for: How do I find the red point to form a perpendicular ...
0
votes
1answer
58 views

Draw a line along one continuous edge of a curved mesh

I have a rectangular mesh, but the mesh is curved: I want to draw a line along one side of this curvy mesh. Currently I can easily draw line along a side of a flat rectangular mesh by getting the ...
0
votes
1answer
60 views

Unity 3D rotating object around 2 axes rotates it around 3

I am developing a 3D space shooter and I've fount that when triying to rotate the ship using X and Y axes it also rotates on the Z axe. The answer here helped me a lot, but now when I try to rotate ...
0
votes
1answer
42 views

How do make a box collider align with a line renderer continuously?

I am having the issue of aligning my BoxCollider2D with my linerenderer. I am trying to have a laser shoot using: ...
1
vote
0answers
19 views

Can I slightly rotate a 2D vector (UV Edge) to more closely reflect the corresponding 3d vector?

I'm trying to get the difference between the 3D angle of two connected edges and their corresponding angle in 2D (mesh to UV space). I would like to slightly rotate the angle in 2D to closer match ...
0
votes
1answer
23 views

Find optimal placement for label/sticker on a simple polygon with holes

I'm working on a real-time archviz renderer and I need to place a label/sticker/decal on walls, which have openings. So one way to think about this is a simple (possibly concave) polygon with holes. ...
1
vote
2answers
122 views

How do I launch a ballistic projectile to hit a moving target, given: launch position & angle, target position & velocity?

This problem is in 3D space. My question is: How do you find the initial velocity of a projectile that flies under constant gravity, so that it hits a target moving with constant velocity, given the ...
0
votes
0answers
17 views

Correct primitive to start with for modified cone shape

I am very new to Maya and trying to make a Nikon F camera from reference images. I can't quite wrap my head around how I would make the shape on top of the camera because it is essentially a square ...
0
votes
2answers
69 views

Detect walls in geometry

Is it possible to automatically detect walls in polygon soup? Of course it's hard to strictly define what a wall is, my slightly vague definition would be: A wall is a largest possible box (not ...
0
votes
0answers
30 views

Generation of a 3D loop the loop with minimal steering required

How would I generate a surface which resembles a loop-the-loop shape like this one described here? After triangulation of the surface, lets say I start at one end with some initial velocity which is ...
1
vote
1answer
51 views

How to know if two surface are in the same direction?

In my code I creat a Mesh that are composed by multiple tile. those tile can have edge that are shared, and I need to know if the normal of the tile that have shared edge have the same direction, ...
1
vote
2answers
55 views

Calculating approximations of contact between two meshes

I'm looking for ways to calculate the degree of contact between two objects in a scene. I was thinking that calculating the hausdorff distance would be a useful approximation if it is then normalized ...
-1
votes
1answer
751 views

Convert 3D direction vectors to yaw/pitch/roll angles

I have the code below that takes a set of yaw, pitch, and roll rotation angles (in degrees), and populates forward, right, and up basis vectors to express this rotated orientation as a Cartesian ...
0
votes
0answers
16 views

Moving and rotating object with another object [duplicate]

Sorry i bad painter)) Need move and rotate 'OBJECT №2' with 'OBJECT №1' I have origin point(also rotation point) and angles of two object. (Also min and max coordinates of these objects) Vector ...
1
vote
1answer
58 views

How can I build an array of coordinates of a truncated icosahedron's faces?

I can easily get a list of coordinates of all the vertices—the Wikipedia page has formulae and this page has a list of them, but that doesn't tell me which ones are part of which face. What I'd like ...
1
vote
1answer
84 views

Move and rotate one object to another C++ [3D]

I have two object, need attach 'TWO OBJECT' to 'ONE OBJECT'. I have vectors 'angle' 'origin' of ONE and TWO objects. I tried do "TWOOBJECT.origin += ONE.origin - ONE.oldorigin", this just attach ...
-1
votes
1answer
119 views

How to detect least distance to line segments calculation

I'm trying to calculate the distance of the player to a few lines that intersect two points, and return the smallest distance (i.e. tell me which of the lines the player is closest to/how far the ...
2
votes
1answer
93 views

Click on an isometric plane and obtain normal coordinates

I have photos distributed as cells. When I click, I get the corresponding row and column. console.log("Col:" + X + "Row:" + Y); When applying an isometric view conversion like this: ctx.translate(0, ...
2
votes
2answers
393 views

Most efficient way to get the closest point to a 3d rectangle

I have a 3D rectangle, with 4 points (x,y,z) And I have a player, who can be anywere (inside the rectangle, outside, not even in the plane, in the corner...). I would like to get the closest point in ...
1
vote
0answers
63 views

algorithm to change the center of the image

I need and algorithm in Java if possible to change the center of the image when scaling.What is happening to me is represented in the first image: when I scale the image the image scale according to ...
0
votes
2answers
54 views

Unity3D - Generate a position within a circular band around the player

Given a certain condition in my game I need to generate a position around the player. It needs to be at least 8 meters away from him and within 10 meters, in a circular matter, as in the dotted green ...
0
votes
0answers
10 views

Object's plane on image

I have a segmented image. So, for example, I know 2D coordinates of pixels for road on image. Now I want to know a plane of this road. How can I do this? P.S. I think it's popular problem, so I'm ...
0
votes
1answer
52 views

Calculating surface normal numerically

Say I have a 2D surface defined with the use of bitmap. I want to use this bitmap for collision detection (white color is where object can move freely, with black I mark the walls). How can I ...
0
votes
1answer
74 views

Get a Jump normal gravity based on Attractor Points, lines or Quad placed in the Level Design (in a Mario galaxy like gravity)

I have an algorithme to find. I have a player in a 3D space on a random planet. My goal is to have an oriented gravity toward my planet. And when I jump: Find the right normal direction. BUT I can't ...
0
votes
0answers
75 views

Getting the Closet Points between Polygons with the GJK Algorithm

I am trying to implement the GJK algorithm by following this lecture. For the most part, it is working, but sometimes 1 of the 2 closest points is incorrect. Here are two examples: EXAMPLE 1: The ...
0
votes
0answers
134 views

Find transformation to align two polygons at fixed points?

Problem I have a source image (arbitrary width and height c) shown here as a rectangle [X1,X2,X3,X4]. It contains two points C and D (both known coordinates within ...
2
votes
1answer
82 views

How to determine polygon based on point lists?

I have several lists of interconnected points. They are ordered so I can connect them together. Using these interconnected points I'd like to find the different points and intersection points that ...
0
votes
0answers
22 views

Is it possible to generate a 2D surface that approaches certain mesh, and then a specialised ray-tracing function for it?

As an example, suppose we are trying to ray-trace a sphere. There are two options. The first one is to build a mesh of triangles approximating the sphere and ray trace it. Unfortunately, the more ...
0
votes
1answer
54 views

Interpreting focal length in units of pixels

I am working on a renderer of sorts and I have some fundamental questions. Let's say I have a vector in a 3D virtual world space which is unitless, and I want to project it onto a 2D screen, so I need ...
2
votes
3answers
250 views

Get closest point on box to line

Eventually this problem will be 3D, so I would like a solution that works in 3D. My player is looking forwards. There is an axis-aligned box on the screen (FOV is guaranteed to be 90, so boxes behind ...
0
votes
3answers
107 views

How can you tell if you are a large player on a large map or a small player on a small map?

If everything is scaled by a constant factor, can you tell that the world is smaller or larger? I think you could look down at the ground and see that it's "closer". But how do you know what ...
1
vote
1answer
28 views

Get the mesh Project Plane on Click and calculate its area

Here is the excerpt of my script which is calculating the surface area and face area of a mesh on OnMouseDown Event. ...
0
votes
1answer
2k views

How to calculate the surface area of a mesh

I am looking for a way to calculate surface area of a 3D mesh object and found this code from a Unity forum: ...
2
votes
1answer
93 views

How can I express Logarithmic and Arithmetic spirals as segmented cubic bezier curves?

I am creating cubic bezier curves using this code from another question I asked. I would like to know how I can express Logarithmic and Arithmetic spirals as segmented cubic bezier curves.
2
votes
1answer
77 views

How to inflate geometry?

I have a shape containing vertices and triangles I want to inflate that geometry using some radius to get something like that I should move each point along ...
5
votes
1answer
543 views

Why are spherical worlds so rare?

I remember back in the 90s when X-Com came out, being really impressed by the way its world map was an actual world: a map of Earth drawn on a spherical surface. That was pretty cool, because I had ...
0
votes
1answer
98 views

Confused by scaling, units, and more

Ok, so I've already waded through a bunch of questions around this, and it's just making me even more confused. Let's say I am trying to model a card table in a 2d game. Behind (beneath) the table ...
0
votes
1answer
42 views

Determine view-matrix with camera placed in a scene graph

My scene is organized with a simple scene graph where the child multiplies its transformation with the one of the parent. For normal objects, likes meshes, this works as expected, but I also want to ...
1
vote
1answer
94 views

Get triangles after subdivision

I was able to do subdivision on a triangle mesh with midpoints but then I get polygons with too many faces. How do I convert to triangles after? Similar to this picture:
0
votes
1answer
55 views

How to implement level-player collisions resolution?

I want to create simple collision response system (physical simulation is not required now). It is needed just that player can't go through walls. I consider some variants: - Just create a set of ...
0
votes
1answer
67 views

Define a circle from a point on its circumference and an angle

I'm working on a 2D, top-down driving game with some basic AI vehicles. The AI Vehicles move along a bidirected graph of positions. Each vehicle has a current position (from the graph) and a target ...
0
votes
1answer
93 views

How can I detect whether a point is moving in a circle?

I want to detect if my GameObject (Vector3 Point) being dragged by the player's finger is moving in a circular fashion. I thought I could save the last 5 points ...
2
votes
2answers
579 views

How to draw a 3D capsule?

I want to draw a 3D capsule defined by a segment (two points start->end) and a radius: Image source: Orionist on Wikimedia Commons I already have a sphere leaning on this answer: https://...
1
vote
1answer
41 views

Aim/Scope Oscillation Algorithm

I have been struggling to find an algorithm to implement something that will make a direction oscillate within a cone constraint, in a helix-shaped fashion as in photo (it will always go back to the ...
1
vote
1answer
55 views

How can I find the reflection of a point in a perpendicular line?

From the image below I know the positions A and B. How can I find positions C and ...
1
vote
2answers
614 views

Getting the bounding box of a sphere

I have a sphere with values center,radius and I need to convert the sphere to a bounding box with values min,max. How do I ...
4
votes
2answers
317 views

Shrink a convex polygon

Shrinking a concave polygon is quite hard, to do well. But I expect shrinking a convex polygon would be easy. The naive approach of moving each vertex a certain distance to the centre gives me poor ...