Skip to main content

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
0 answers
897 views

Mythbuster: Mirror Operation with Quaternion

Mirror operation : all vertex positions must be reflected by a specific plane (here YZ).Synonyms: FlipHorizontal, SymmetryX, MirrorX, What implementations I already know that work: 1) Multiplying ...
user2186597's user avatar
2 votes
2 answers
706 views

Using a vector to measure an angle relative to the screen / camera

My game is supposed to have an object that changes it sprite depending on which way the mouse faces. programming this has become a challenge, because I want to calculate the angle relative to the ...
Plug's user avatar
  • 130
3 votes
4 answers
152 views

Detecting single circle within multiple circles area

There are multiple circles with same radius, given another circle in different radius, how to detect the another circle is fully in multiple circles area. Image below shows left samples is in the ...
jiejieup's user avatar
28 votes
6 answers
8k views

If a 3D vector represents a point, how can it have a length?

I am trying to understand vector arithmetic (and specifically its use in the Unity engine). I am not able to figure out how a vector can have a length (magnitude) even though it only represents a ...
Mohammed Noureldin's user avatar
2 votes
2 answers
248 views

Find points inside a closed area

I have a 2D rectangular grid (100x100) with 3 types of cell (Empty, Base and Outline). I need to find cells inside the territory formed by Base and Outline cells. For example, in this scheme: I need ...
Aleksandr Rozanov's user avatar
2 votes
1 answer
789 views

Moving a sprite along a circle given by an implicit equation

I’m trying to create a hyperbolic version of Pong in a Poincaré disk, using C++ and SFML. Here is my problem: when the ball rebounds on a paddle, I deduce two coordinates allowing me to recover the ...
Kn0wledge's user avatar
1 vote
1 answer
91 views

Ensuring linear velocity remains constant even when turning

I am using Ackermann steering to rotate a vehicle. The code is as follows: ...
Simian's user avatar
  • 57
2 votes
1 answer
128 views

Best way to get the maximum moveable Area

I was thinking about creating a polygonal area, for a given unit, in which it can move with a given range (radius) but with care for obstacles. Here is a picture to visualize my idea: My Ideas so ...
LuaNoob's user avatar
  • 161
1 vote
1 answer
1k views

Calculate evenly distributed points along a curve

I'm using this equation to calculate a series of points along a quadratic curve: ...
Robin Rodricks's user avatar
1 vote
0 answers
109 views

Making world geometry with Ogre3d

In Ogre3d's manual and in the documentation it's said that Ogre::Mesh shouldn't be used for world geometry. Quoting the manual: Mesh objects are assumed to represent movable objects and are not ...
Narrateur du chaos's user avatar
0 votes
1 answer
797 views

Determining Rectangle-Circle Collision Point

I'm developing a 2D game engine currently. I stuck on determining position of a rectangle that collides with a circle when its speed is added to its position. Rectangles have only x axis speed. On ...
Barış Doğa Yavaş's user avatar
0 votes
1 answer
461 views

Calculate the leaning angle

I have an object moving around, let's say it's a cycle. In cycle dynamics, when the object takes a turn, it often leans into the direction of the turn. I would like to simulate this. I'm using the ...
Letokteren's user avatar
0 votes
2 answers
257 views

Find X,Y Spiral positions by given ID. Hard formula.

I need to spawn new villages in my grid-based game map. But i am weak in advanced math.. I need to fetch coordinates by id. These 2 constants can be other numbers. Please help with the function in ...
mansim's user avatar
  • 191
1 vote
0 answers
136 views

Speed of procedural geometries

I'm evaluating solutions for creating a VR videogame that should run on cellphones. The assets will be streamed from our servers and that could be a problem on limited capabilities devices. Since the ...
user3834459's user avatar
1 vote
1 answer
148 views

Problem with Rotating Third Person Radar UE4

I am doodling on the Flying game template on UE4. I am making a 2D radar on top left. Radar's north direction is the pawn's forward direction. So when it approaches to an object with the dotProduct ...
alicankoker's user avatar
1 vote
2 answers
4k views

How can I randomly pick points on a triangle?

Please can help me for a geometry query, I am working out fast mesh to voxel algorithm without using rays and complex maths... What are the maths to sample N points on a triangle randomly? If you ...
bandybabboon's user avatar
67 votes
2 answers
31k views

I'm rotating an object on two axes, so why does it keep twisting around the third axis?

I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can ...
DMGregory's user avatar
  • 135k
0 votes
3 answers
4k views

How does one calculate the surface normal, in 2D collisions?

I have a ball, which should bounce when it collides with a surface. I know the formula for reflections; $$ v_1 - 2n(v_1 \cdot n) $$ However, I cannot obtain the required information. I know: the ...
あらまあ's user avatar
0 votes
1 answer
77 views

There any way to insert images inside the code (just for comprehesion) in any IDE compatible with Game Engine Unity3D (Monodevelop for example)? [closed]

My code has a lot of geometry codes, thinks that shouldn't be represented just by comments I don't know if it exists, but should be fine to insert images like png in the middle of codes explaning that ...
JamesB's user avatar
  • 279
0 votes
1 answer
55 views

Coordinates of the corners of a rectangle bridging two circles

I am implementing a game that involves slingshots and circular objects. I have gotten the basic "geometric" construction down for rendering the slingshot, but I am having trouble implementing this in ...
Danyil Bee's user avatar
1 vote
3 answers
229 views

Collision Detection works 2 sides

This might be really simple but it is giving me a lot grief and I wondered if you guys would be able to shed some light on it. Basically I have a tile map which draws tiles at 64 * 64 and that works ...
Anonymous5642's user avatar
1 vote
0 answers
224 views

Reconstructing 3D Rotation from 8 byte - Assistence required

I am currently trying to load 3D models and animations into a program. The file format has no public description, so I am decoding them piece by piece. (I'm studying computer science and it's for ...
rootmenu's user avatar
  • 131
1 vote
2 answers
909 views

Overlap color between objects

I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
EzeEst's user avatar
  • 83
0 votes
2 answers
195 views

Determine the z coordinate of a deformed plane based on uv (xy) coordinates

I am using a formula to turn the following texture into what looks like two 3 dimensional planes The formula I am using for the texture deformation is ...
user1423893's user avatar
0 votes
1 answer
86 views

Push cube outside triangle face [closed]

I'm creating a 3D game, and I need to know how to push a player (axis aligned box/cube) outside a triangle. How can I get get the push direction?
Hugo Flores - Slaynash's user avatar
0 votes
1 answer
424 views

Move object forward according to rotation

How do I make an object (like a bullet) go forward according to its rotation in vanilla nodejs (my game server language)? For example, if an object's rotation is 0 degrees, then it goes straight up.
Big Ben GamerGuyKSPMC's user avatar
2 votes
1 answer
3k views

Finding if 2 polygons intersect using clipper library

After realising my code was pretty inefficient at checking for polygon overlaps, I've turned to a mentioned library Clipper but finding it difficult to know hot to use it for this operation. I am ...
dolyth's user avatar
  • 445
0 votes
1 answer
392 views

Finding when shapes overlap and lines intersect but exclude points/edges

I've been looking for a c# algorithm to help determine if shapes and lines intersect but want to exclude boundary overlaps. Here's an example: My true problem is finding if polygons intersect but ...
dolyth's user avatar
  • 445
1 vote
1 answer
205 views

Points inside a Polygon, failing for shapes with 0,0

I've been using an algorithm (http://wiki.unity3d.com/index.php/PolyContainsPoint) to tell me if a point is inside a polygon... in fact a few variants (here and here) but they all come back the same. ...
dolyth's user avatar
  • 445
2 votes
1 answer
970 views

Checking if shapes will tessellate

I'm trying to figure out where to start with getting code together to check if a shape tessellates. An example: Consider that the shapes cannot be rotated, just as-is. A 'compound' shape (as seen in ...
dolyth's user avatar
  • 445
2 votes
2 answers
207 views

Given a grid system where some coordinates are marked as impassable, how to find natural-looking car driving path between two locations?

I can compute an A* path, but I get only cardinal directions from that. A 45˚ path would look like "up 1 left 1 up 1 left 1 up 1 left 1..." My specific question is, given a grid with a pathing ...
xaxxon's user avatar
  • 484
18 votes
1 answer
4k views

Algorithm for "healing" multiple rectangles into a smaller number of rectangles?

Say I have a grid of rectangles of different shapes and colors and I want to reduce (reasonably close to optimal is fine, optimal is not necessary) the number of rectangles to represent the same ...
xaxxon's user avatar
  • 484
0 votes
1 answer
30 views

Lengthen Line (bidirectional) - crossing zero line

I'm trying to lengthen a line, by a certain amount. I want to apply the modification to both points on the line, expanding it in both directions. without moving it from it's current position (center ...
TolMera's user avatar
  • 103
1 vote
1 answer
155 views

Calculating the inverse mesh of a 2D mesh inside a bounding box

If I have a mesh (drawn in red below) How can I calculate the inverse of the mesh (drawn in red below), given that the mesh is always constrained by the same four vertices of the encompassing ...
user1423893's user avatar
0 votes
0 answers
296 views

What shapes interlock solidly like cubes?

What basic geometric shapes, besides cubes, interlock "minecraft" style like cubes? A small edit to make question more suited to Game Dev: I am experimenting with game dynamics to create geometric ...
Pipsqweek's user avatar
  • 173
-1 votes
1 answer
262 views

is there a way to check if a point is inside circle, other than distance between points?

Is there a way to check if a point is inside circle, other than distance between points? I am struggling with floating point precision problems. Is there some method to do the same test, but with more ...
NIki's user avatar
  • 15
2 votes
1 answer
10k views

How to draw an arc between two angles?

I'd like to draw an arc between two specific angles. For example, "draw an angle between 0 and 90 degrees" and it will draw only that part of the circle and ignore the rest.
poudigne's user avatar
  • 245
1 vote
2 answers
680 views

Best way to test if some point on a line if in front of another point on the same line in 3D

I have a line in 3D defined by point P0 and direction vector D. For given input point P on a line defined as above, I want to test if P is in front of point P0. The code will be used in GLSL fragment ...
Lisur's user avatar
  • 73
1 vote
2 answers
4k 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 ...
Robin Rodricks's user avatar
0 votes
1 answer
239 views

How can I detect handedness of normal maps in a shader?

I've implemented normal maps into my game renderer using the formulas by Christian Schuler. It works OK with most normal maps but some not so much since in some the Y component (green) is reversed. ...
Yudrist's user avatar
  • 963
2 votes
1 answer
125 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 ...
SMKS_ARTS's user avatar
5 votes
1 answer
6k views

How does a 4x4 matrix represent an object in space and matrix lore?

I have been following some tutorials on how Matrix maths works, with adding, dividing, scaling, etc, but I am struggling to understand how the 4x4 matrix represents an object's position in space. ...
0xen's user avatar
  • 453
3 votes
1 answer
152 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. ...
AquaGeneral's user avatar
3 votes
0 answers
152 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: ...
MaiaVictor's user avatar
  • 1,180
0 votes
2 answers
64 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"...
Aidan Pallian's user avatar
0 votes
1 answer
373 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 ...
AndraSol's user avatar
  • 177
1 vote
1 answer
279 views

In Unity shaders, how is IN.worldRefl calculated?

I want to know how the world reflection vector in shaders is calculated so that I can manipulate it, but there is no documentation on what it does or how Unity calculates it. How is the reflection ...
Raymond Lin's user avatar
0 votes
1 answer
202 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 ...
Lamda's user avatar
  • 135
7 votes
2 answers
1k 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 ...
SkidRunner's user avatar
-3 votes
1 answer
175 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: ...
Edward Severinsen's user avatar

1
3 4
5
6 7
11