Skip to main content
9 votes
Accepted

How to calculate the surface area of a mesh

Looking at the formula you're using, it looks like it's designed to calculate the area of a planar polygon, where the vertices are all in clockwise / counterclockwise order about the perimeter. That'...
DMGregory's user avatar
  • 135k
3 votes
Accepted

Intersection of two limited planes (stripes)

For the case that someone needs this one day... I solved it by computing the intersection line of the two planes (explanation and code here: http://geomalgorithms.com/a05-_intersect-1.html ) and then ...
DragonGamer's user avatar
3 votes

Easy way to project point onto triangle (or plane)

There is an excellent answer to this question on the Math community of Stack Exchange: Determine if projection of 3D point onto plane is within a triangle. Which is, in turn, just a summary of this ...
Craig Reynolds's user avatar
2 votes

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

Based on the other answers, and to complement them, I managed to create an example with P5 here. Here is the code, in case you want to access it directly: ...
Danfus's user avatar
  • 91
2 votes

How to calculate plane corner vertices from plane origin point and plane normal?

Here's one way that I can think of to do it. Find a point on the plane a other than the origin, o. The vector ...
Jay's user avatar
  • 810
2 votes

Sphere to plane collision

You're overcomplicating this. ...
DMGregory's user avatar
  • 135k
1 vote

How does unity refer a to a normal when there are so many?

How Unity calculates the collision normals depends on the types of colliders involved. It's worth noting that unity will offload all of this to a physics engine (primarily nVidia PhysX), so in a lot ...
Basic's user avatar
  • 1,278
1 vote

How to calculate plane corner vertices from plane origin point and plane normal?

I had to go through a similar situation lately, and here is something that might be more complete than the provided answer. You provide a normal and the origin. Using the origin is a very specific ...
Vaillancourt's user avatar
  • 16.3k
1 vote
Accepted

Recalculating normals on a tesselated cubed sphere with heightmap applied

Recalculating surface normals for a given triangle is simple: Given a triangle is composed of 3 points (p0, p1, p2), The face normal(Nf) can be defined as: ...
Ian Young's user avatar
  • 2,649
1 vote

How to calculate the surface area of a mesh

Shamelessly building on DMGregorys answer.. You can also define this as an extension method for the Mesh class. ...
Neuron's user avatar
  • 113
1 vote

Fastest visibility calculation towards all possible directions

Minecraft has to solve a similar problem for culling caves and other landscape features that are occluded from view. There's a detailed write-up here about the Advanced Cave Culling Algorithm they ...
DMGregory's user avatar
  • 135k
1 vote

Detecting single circle within multiple circles area

Another trick you can try is exploiting the Minkowski Difference. First, combine all your background circles into a compound shape where they overlap, so you have a single sequence of arcs ...
DMGregory's user avatar
  • 135k
1 vote

Detecting single circle within multiple circles area

The first case is as simple as checking whether the offset between the centres added to the radius of the contained circle, is less than the radius of the container circle. Your second example on the ...
Engineer's user avatar
  • 30k
1 vote

Is there an algorithm to move vertices along a planar mesh to give an area more vertex without destroying the shape too much?

Some kind of optimization algorithm should do the trick. I assume that this is not a time critical task, rather done during development or initialization, not during game play. Furthermore, that you ...
NoDataDumpNoContribution's user avatar
1 vote
Accepted

Lengthen Line (bidirectional) - crossing zero line

...
Ian Macintosh's user avatar
1 vote

Image-Space coherence of the z-buffer algorithm

There are two possibilities that occurred to me: 1) Triangles meshes are typically supplied in one of strip, fan, or indexed triangle lists. Since the first two automatically imply adjacency of (at ...
Simon F's user avatar
  • 199
1 vote

Image-Space coherence of the z-buffer algorithm

The Z-Buffer algorithm itself does not use image-space coherence concept, it works exactly as we know. But the result of this algorith is quite coherent, which means that for any given pixel there's a ...
kolenda's user avatar
  • 1,370
1 vote

How to construct the marching cubes tables algorithmically?

Disclaimer: Not tested yet. Edit: Tested and works, code on demand. The configuration, or rather the mesh, can be calculated in a slightly simpler, in my opinion, way, although this is less efficient,...
Max Izrin's user avatar
  • 111
1 vote

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

Refactoring the code above gives a cleaned up form which also highlights the simple fact that each corner is basically center + height/2 + width/2, with signs as ...
leamas's user avatar
  • 11
1 vote

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

Possibly, there is some optimizations available by dividing the problem into two: compute the center of the top and the bottom side i. e., center + the rotated height/2. compute the corners relative ...
Alec Leamas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible