Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [geometry]

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

0
votes
0answers
22 views

Seamless UV painting in 3d

I have a 3d model with UV and texture. User sets 2 points on the screen, then I calculating UV's of theese 2 points using Möller–Trumbore intersection algorithm, bake a few times using interpolation ...
0
votes
2answers
33 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
27 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
68 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 ...
1
vote
0answers
46 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 ...
1
vote
0answers
108 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
74 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
20 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
22 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 ...
0
votes
1answer
28 views

Get closest point on box to line

Eventually this problem will be 3D. My player is looking forwards. There is an axis-aligned box on the screen (FOV is guaranteed to be 90, so boxes behind the player aren't considered.) I want to ...
0
votes
3answers
102 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 ...
0
votes
1answer
14 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
393 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
66 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
66 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
359 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
79 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
30 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 ...
0
votes
1answer
74 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
49 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
64 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
0answers
40 views

Tetrahedron Circumsphere

Following this question, I want to create a sphere from a tetrahedron using this Wolfram support. But so far the resulted sphere is bigger than it should be and center seems to have an offset. ...
2
votes
2answers
317 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
38 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
54 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
278 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 ...
3
votes
2answers
238 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 ...
2
votes
2answers
188 views

Find extreme points of a rotated ellipse function on a given axis

How to find the points where it is most extreme on the X and Y axis? For example lets say I have an equation that describes an ellipse that is rotated: ...
0
votes
1answer
391 views

Getting the winding order of a mesh

I'm doing some topological operations on my mesh and I need to know the winding order for my mesh. Since I will be importing models from different sources I will need to know whether the winding ...
0
votes
1answer
42 views

Display dynamic texture image on inside of sphere

I'm displaying a ring wherever the camera 'looks'. When the camera faces the ground (green) the ring image always looks correct, see image: However, my scene is within a sphere (purple)... and when ...
0
votes
2answers
257 views

How can I convert my list of vertices and indices to a list of triangles?

I have a full 3D collision mesh that is represented by a list of vertices and another list of indices. I need to convert the list of vertices and the list of indices into a set of triangles. First I ...
0
votes
1answer
158 views

Removing duplicate vertices on a mesh

I have a set of vertices and another set of indices. Sometimes I find that I have duplicate vertices in my mesh. I tried at first to check if two identical vertices were in the array of vertices but ...
0
votes
1answer
92 views

How to get a reflex edge on a non-convex mesh

I am trying to implement a convex decomposition and I need to find the convex vertex on a mesh. Is there a algorithm that I can use to find the convex vertex on a mesh.
3
votes
0answers
69 views

How to implement a pannini projection in opengl?

I have read about the pannini projection, which involves (I think) projecting a scene onto a cyclinder instead of a rectangle. How can I implement this projection in a vertex shader? Blinky is using ...
-3
votes
1answer
50 views

How perform for obj follow mouse with angle?

how i can perform for sprite follow mouse if i change angle ? If i change angle the sprite no more follow mouse correctly. I absolutely need the obj follow mouse with pivot. https://jsfiddle.net/...
0
votes
2answers
128 views

Getting position of a coordinate on the surface of a sphere

So I want to create a object B close to another object A, but I'm trying to avoid that A covers B: I have thinking how to achieve that. Take a look of the following drawing: I have been thinking in ...
3
votes
1answer
87 views

Find ID from Spiral x, y positions. Hard programming formula

I have a formula, which gets coordinates from user_id (see below). I give User_id, and I get back coordinates. But now I need to get User_id from coordinates. For example: ...
0
votes
1answer
82 views

Draw triangles around screen

I am trying to draw triangles around the screen something like this: This is my script which can draw 6 triangles but I am not sure how to expand it to draw more like 8 or 10 triangles. Any help is ...
1
vote
0answers
56 views

Distance from capsule center to point on the surface

this question is engine agnostic, I will use the term "object" to refer to entities in my scene. The scenario is the following: I have 2 entities Entity O is a capsule Entity C is a point I want to ...
1
vote
1answer
71 views

Get / Calculate edges of a 3D object - C #

I need to get all vertices in the edge position of a determinate object 3D (in this case a path). See the image: My question is, how can I get only the edges vertices, like the image?
1
vote
1answer
185 views

Playing Tetris on non-linear surfaces

I am considering designing a Tetris game where instead of a traditional flat game board, the game will transform the board into different kinds of surfaces. I think I lack the appropriate mathematical ...
2
votes
0answers
27 views

Defining a coordinate system for player residing in another coordinate system

I'm making a game and I wanted to simplify some code by taking advantage of linear algebra. I'm a little stuck. Let's say the player (green triangle) resides in a coordinate system where the x-axis ...
1
vote
0answers
54 views

Modern way of getting points within a distance?

I'm making a game engine, and some components may want to interact with others based on distance. Currently, the component registers an update listener which runs on a loop, then it checks the ...
0
votes
1answer
294 views

How to draw geometric shapes to a texture?

How can I create a texture containing a geometric figure using SDL2? I saw there is a way to convert Surface to Texture, and I also saw that there is a way to draw directly to the screen using ...
0
votes
1answer
282 views

How can I sort vertices efficiently in a specific direction (CW/CCW)?

I am trying to triangulate a set of points using a very simple approach where a base vertex is chosen, and then every other vertex is joined to its neighbouring vertex and then back to the base vertex,...
2
votes
3answers
579 views

OpenGL: How do I map a square texture onto a rectangular surface?

I'm not asking about how to map the texture itself. I'm just wondering how I could go about evenly mapping a texture to an object so that it repeats itself instead of stretching to the surface. For ...
1
vote
1answer
145 views

Calculating the geometry of a thick 3-way miter joint

Following a very helpful post on another forum I've found a simple algorithm that takes an array of 2D vectors and creates a triangle strip. I've modified the source code for my purposes. I haven't ...
3
votes
1answer
400 views

Efficient minimum distance between two axis aligned squares?

I have two 2D arbitrarily-positioned axis-aligned squares. I need to find the minimum distance between those squares – i.e. if you were to draw them, what's the length of the shortest line you could ...
7
votes
3answers
978 views

Why is the depth test not done on geometry before rasterization?

It seems the only time depth is used to discard data is during rasterization, i.e. at the fragment level. In the geometry stage, I've only see culling and clipping of vertices. Is it not possible to ...