Stack Exchange Network

Stack Exchange network consists of 174 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.

3
votes
2answers
216 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 ...
0
votes
2answers
988 views

How to rotate a local position offset based on a direction vector?

I'm trying to fire three raycasts in the direction of movement, from offset starting points. I'm having trouble calculating the start positions of the rays based on the direction. As you can see in ...
-3
votes
2answers
1k views

Describing the spherical cap intersection between a spherical shell and a solid ball

I have: an infinitely thin sphere shell with center O1 and radius R1, and a solid ball with center ...
4
votes
1answer
248 views

Rotate perspective camera to align screen width to procedural object's width (Unity, C#)

I give up. After much trying and searching, I have to say I was unable to achieve the following task, for which I must call for your wise advice. In my current Unity 5 application (using C#), there ...
0
votes
1answer
13 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
1answer
13 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
65 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
344 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:...
-1
votes
1answer
415 views

Why is this unity camera moving in weird directions?

I have the following script ...
-3
votes
1answer
47 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/...
3
votes
0answers
64 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 ...
2
votes
0answers
25 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 ...
2
votes
0answers
50 views

How to draw circular sectors on polar grid only within bounding rectangle

I'm attempting to optimize a game map by only drawing circular & annular sectors within the current viewable rectangle bounds. The solution should cover both cases in the example graphic (Figs 1 &...
2
votes
0answers
60 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 ...
2
votes
0answers
79 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: ...
2
votes
0answers
653 views

How to trace contour of shapes with holes?

I am experimenting with the RVO2 library for collision avoidance in a 2D simulation. This library supports specifying arbitrary obstacles as a list of vertices. The obstacles must be full shapes, i.e. ...
1
vote
0answers
43 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
0answers
53 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 ...
1
vote
0answers
40 views

How can I append geometrical objects over a circle LibGDX

I want to draw geometric shapes over circle with using the graphics library in LibGDX like that; As you see from image, I want to append blue shapes to black circle. Any advice ?
1
vote
0answers
284 views

Triangulating a 3D mesh from a set of data points

I'm trying to implement the Bowyer-Watson point insertion version of the Delaunay triangulation algorithm, but in 3D. I previously implemented the 2D version without problems, but when transitioning ...
1
vote
0answers
26 views

Algorithm for clipping convex quadrilaterals

I'm dealing with hardware that uses quads as its polygonal primitive. Not triangles. A triangle can be expressed by setting 2 of the 4 equal to each other for a degenerate quad. For the 3D engine, I'...
1
vote
0answers
29 views

Creating Smooth Corners when Converting 2D Polylines to 3D Models

Part of my game takes SVG polylines (which are just basically a set of x,y coordinates that define a multi-segment line) and converts them into 3D 'paths' (ie. a line created as a set of faces all ...
1
vote
0answers
113 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 ...
1
vote
0answers
84 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 ...
1
vote
0answers
34 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 ...
1
vote
0answers
178 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 ...
1
vote
0answers
164 views

HLSL topology mismatch question

I'm trying to write a fur shader with the shells & fins technique. Currently I receive this DirectX error D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: The declared input primitive type in ...
1
vote
0answers
213 views

2d grid vision(eye sensor) for a neural network bot?

I have a 2d grid and neural network bots living above it. What is a good way to give them vision of tiles in front of them? Below I describe my idea that I don't know how to efficiently(or ...
1
vote
0answers
55 views

Detecting the two Vector3 that determine the bottom-edge of the side of a box-collider that had collision (with C#)

So, I understand that plenty of questions have been posted on how to detect which side of a Box Collider had collision. However, what I am trying to achieve is a little different. I want to find out, ...
1
vote
0answers
599 views

Calculating Minimum Translation Vector in Separating Axis Theorem based algorithm

In the 2D SAT collision determination algorithm, you project the convex polygons onto each potential separating axis. Supposing the polygons intersect, from what I understand, the axis for which the ...
1
vote
0answers
223 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
1
vote
0answers
69 views

Blender: calculation of elevation and rotation angle from plane

I have a generic plane (any location, any rotation around every axis) with its normal axis passing by the center. Then I have a generic point and I need to find the elevation and the rotation angle ...
0
votes
0answers
18 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
0answers
54 views

Weird behaviour of glsl with fragment, vertex and geometry shaders

I am a beginner in developing games. I started some time ago with OpenGL and the glsl language. These days I am having so many problems and for me it is too difficult to solve, because the shaders are ...
0
votes
0answers
39 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. ...
0
votes
0answers
21 views

Approaching behavior with acceleration and unlimited velocity

I'm encountering a difficult programming/math/geometry problem. I think it's best to ask here, but I could be wrong, if so please let me know where you think it might be better suited. I'd have a ...
0
votes
0answers
80 views

Algorithms on Random Level Generation with Predefined Objects and Constraints

Let's say I'm developing a game where a city is generated and buildings are placed in a random manner. Methods to generate the roads are easy to find, it is akin to creating a maze but I can't think ...
0
votes
0answers
40 views

How can I make a polyheadron regular in Maya?

Let's say that I created a tetrahedron manually, and for the sake of the question pretend that you can't just create pyramids as primitives. My pyramid is not a regular polyhedron; there are edges ...
0
votes
0answers
308 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 ...
0
votes
0answers
105 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 ...
0
votes
0answers
145 views

How to convert Non-Axis Aligned Bounding Boxes to AABB

I'm trying to write a raytracer to render boxes (cubes) that are arbitrarily rotated, i.e. not necessarily axis aligned. While I'm reasonably comfortable ray-tracing an axis-aligned cube, I don't know ...
0
votes
0answers
131 views

Project 2d click/touch onto 3d plane

I have a 3d scene that contains an infinite plane that is NOT parallel to the camera (so every screen coordinate corresponds to a point on this plane- in other words, there are no possible invalid ...
0
votes
0answers
87 views

boost/geometry replacement in Java/for the JVM (Destructable Box2D terrain)

I'd like to reimplement https://github.com/seemk/DestructibleBox2D in Java. The main problem is finding an adequate replacement for the boost/geometry library. Any ideas?
0
votes
0answers
49 views

3D Picking: Doesn't Work Consistently

I'm trying to implement a 3D picking function that at the moment simply calculates the ray being sent from the camera after the user clicks the mouse on the window. It kind of works well when the ...
0
votes
0answers
712 views

Taking a 2D slice of a 3D volume

I have a regular 3D polygon and I'd like to display 2D slices of it. What is the best way to achieve this? (Preferrably in OpenGL, but a general algorithm/tecnique would be good as well). I've ...
0
votes
0answers
45 views

Rotating between two coordinate frames

I have two coordinate frames, A and B. I want to create the rotation matrix RAB which takes you from A to B. A is a right-handed system, and B is a left-handed system. Furthermore, after moving from a ...
0
votes
0answers
80 views

Fat geometry shader

I've seen this video: all the geometry seems to grow and become fat. Nice effect. I'm just approaching the shader matter, and I'm still have to learn a lot about how to change geometry via shaders. ...
0
votes
0answers
68 views

Rasterizing euclidean planes

I'd like to visualize a BSP tree. To do this, I need to project an arbitrary euclidean plane onto a projection plane. I was thinking about calculating the intersections of the plane with the viewing ...
-1
votes
0answers
33 views

Geometrically aligning two 3D objects together?

Let's say I have 2 similar objects I need to align together about the target's center at runtime. Given their positions (x, y, z) and rotations in the world, how would I do this? They need to match ...