The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [computational-geometry]

Computational geometry is the study of solving geometric problems using efficient algorithms and data structures, often in real time.

Filter by
Sorted by
Tagged with
5
votes
1answer
7k views

Sphere-Sphere intersection and Circle-Sphere intersection

I have code for circle-circle intersection. But I need to expand it to 3-D. How do I calculate: Radius and center of the intersection circle of two spheres Points of the intersection of a sphere and ...
16
votes
8answers
42k views

How to calculate corner positions/marks of a rotated/tilted rectangle?

I've got two elements, a 2D point and a rectangular area. The point represents the middle of that area. I also know the width and height of that area. And the area is tilted by 40° relative to the ...
5
votes
2answers
1k views

a flexible data structure for geometries

What data structure would you use to represent meshes that are to be altered (e.g. adding or removing new faces, vertices and edges), and that have to be "studied" in different ways (e.g. finding all ...
4
votes
1answer
305 views

How can I test if an object will “fit” during pathfinding?

I'm tinkering around with a 2d game where obstacles are polygons of arbitrary shapes, sizes and locations, and movable entities (players/enemies) can also be of arbitrary sizes. What's a good general ...
6
votes
1answer
9k views

Quads Vs Triangles

I'm curious to know which is better for games: quads or triangles? Wouldn't quads be better for rendering performances and smoothing out tessellation?
3
votes
2answers
1k views

Scan-Line Z-Buffering Dilemma

I have a set of vertices in 3D space, and for each I retain the following information: Its 3D coordinates (x, y, z). A list of pointers to some of the other vertices with which it's connected by ...
2
votes
6answers
3k views

Testing whether two cubes are touching in space

Does anyone have any clean ideas on testing whether two cubes in 3D space touch? By touch I mean, touch at corners or on a face or on an edge. Say that the cubes are axis aligned and there is no ...
1
vote
2answers
319 views

How do i calc what side the ball is of the rect?

I have this nice drawing: http://bildr.no/view/1085283 I know the ball's center and the rectangle's center, but how do I know (programming C#) what side of the rectangle the ball is? By my drawing, ...
0
votes
1answer
343 views

Scanline filling of polygons that share edges and vertices

In the image below (a perspective projection of an icosahedron), the scanline (red) intersects that vertex at the top. In an icosahedron each edge belongs to two triangles. From edge a, only one ...
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: ...