Hot answers tagged

32 votes
Accepted

What is the simplest way to compute principal curvature for a mesh triangle?

When I needed an estimate of mesh curvature for a skin shader, the algorithm I ended up settling on was this: First, I computed a scalar curvature for each edge in the mesh. If the edge has positions $...
Nathan Reed's user avatar
  • 24.7k
26 votes
Accepted

Why are quads used in filmmaking and triangle in gaming?

For 3D modeling, the usual reason to prefer quads is that subdivision surface algorithms work better with them—if your mesh is getting subdivided, triangles can cause problems in the curvature of the ...
Noah Witherspoon's user avatar
24 votes

What is the simplest way to compute principal curvature for a mesh triangle?

Just to an add another way to the excellent @NathanReed answer, you can use mean and gaussian curvature that can be obtained with a discrete Laplace-Beltrami. So suppose that the 1-ring ...
cifz's user avatar
  • 2,518
24 votes
Accepted

Why do T-junctions in meshes result in cracks?

lhf's answer is good from the perspective of tessellation, but these can occur with simpler triangle mesh use cases. Take this trivial example of three, screen-space triangles, ABC, ADE and DBE... ...
Simon F's user avatar
  • 4,161
20 votes
Accepted

Programmatically generating vertex normals

Computing the normal from vertex positions is quite simple using the vector cross product. The cross product of two vectors $u$ and $v$ (noted $u \times v$, or sometimes $u \wedge v$) is a vector ...
Julien Guertault's user avatar
16 votes
Accepted

Why smoothed meshes in 3D studio end up with the same number of vertices/triangles? How then can they be smoothed with the same geometry?

Smooth in this case just makes the surface normals at vertices point the same way, when interpolated it looks smooth. Meshsmooth would add vertices. 1) how is the smoothing possible without ...
joojaa's user avatar
  • 8,377
12 votes

How to Calculate Surface Normals for Generated Geometry

I see mainly three ways of computing normals for a generated shape. Analytic normals In some cases you have enough information about the surface to generate the normals. For example, the normal of any ...
Julien Guertault's user avatar
11 votes
Accepted

How to Calculate Surface Normals for Generated Geometry

You simply dont want fully smooth results. While the commented method by Nathan Reed: "Calculate each vertex to face normal, sum them, normalize sum", generally works it sometimes fails spectacularly. ...
joojaa's user avatar
  • 8,377
9 votes

Why do T-junctions in meshes result in cracks?

When modeling parametric surfaces with a mesh in the parameter domain, T-junctions will most probably appear as discontinuities in the surface. These will show up as gaps in the rendering. See below. ...
lhf's user avatar
  • 724
9 votes

Why are quads used in filmmaking and triangle in gaming?

As @Noah Witherspoon correctly, says triangle subdivision does not work as well as quad subdivision. Although, in the beginning triangles could not be subdivided at all. However, he does not really ...
joojaa's user avatar
  • 8,377
8 votes
Accepted

Combination of Triangles and Quads in a mesh

Topologically correct is a very vague. I believe you think of Polygon-Meshes when you say meshes, which is to represent the surface of the object by a patch of polygons, in most cases triangles or ...
Dragonseel's user avatar
  • 1,800
8 votes
Accepted

What is the benefit of using Half Edge over Winged Edge?

As far as I can tell, the main advantage of half-edge is that traversal can be a bit simpler due to a guarantee of edges having a consistent orientation within each face. Consider the problem of ...
Nathan Reed's user avatar
  • 24.7k
7 votes

Ordering a set of unorganized points along a curve

You have an instance of a problem called curve reconstruction from unorganized points. Now that you know what to search for you'll find several methods, such as the crust, NN-crust, etc. Here are a ...
lhf's user avatar
  • 724
7 votes
Accepted

Gaussian blurring a function defined over a surface mesh

A few different approaches I'll consider a few variations on your specific request, since you mention efficiency and I suspect your specific request may be the least efficient. I'll also suggest ways ...
trichoplax is on Codidact now's user avatar
6 votes

Human Readable/Writable 3D Representation Formats/Languages?

There are a number of formats that might fit the bill. Depends on what you want to achieve. Most likely your looking for a scene description language for renderers. Many of them are for that one ...
joojaa's user avatar
  • 8,377
6 votes

Creating shared vertex normals on GPU

For an nVidia only solution you can use floating point atomic add intrinsics (like NvInterlockedAddFp32) Unlocking GPU Intrinsics in HLSL | NVIDIA Developer I tried this on 80.000 vertex mesh and it'...
Florent Tournade's user avatar
6 votes
Accepted

Optimal memory access when using lookup tables on GPU?

The best place to put a look up table for a GPU compute shader depends on the size of the lookup table, and the frequency/coherency of access. In your case (you mentioned 4kb), shared local memory ...
GroverManheim's user avatar
6 votes

Generate mesh from pointcloud data

one popular Real time surface reconstruction method is TSDF (Truncated Signed Distance Function) used by Microsoft for the Kinect. It is based on the VRIP method but it is faster. It is based on depth ...
ChaimDryzun's user avatar
6 votes
Accepted

How to calculate volume of any given 3D mesh

The triangle form of the Shoelace Formula can be extended to 3D by using tetrahedrons instead of triangles. Pick a point, Any point can be used, even one of the original vertices of the mesh (...
lfgtm's user avatar
  • 411
5 votes

Why do T-junctions in meshes result in cracks?

Floating-point rounding error. After you transform the T junction and the point in the T can get rounded away from the edge. Then it can happen that a fragment that gets sampled for a pixel lies in ...
ratchet freak's user avatar
5 votes
Accepted

chess-like rectangles on the mesh

I don't think it's trying to represent anything in particular. In CG there is a concept of textures, which is a bit like painting the surface of an object a specific color/look. For example, on a car ...
Peter's user avatar
  • 519
5 votes
Accepted

What's the simplest, open, animation format?

For what it's worth, the glTF Tutorials contain a section on Skinning that shows how the raw vertex and joint weight data feed into a vertex shader to distort the mesh. If you do design your own ...
emackey's user avatar
  • 369
5 votes
Accepted

Are vertices of each LOD version always loaded into VRAM

Many game engines have texture streaming, which means that not all mip levels of each texture are loaded at all times. The game engine will track which textures are in view and how close up they are ...
Nathan Reed's user avatar
  • 24.7k
4 votes
Accepted

How to determine the object-to-world matrix

No! If you dont have this info and must have a extra frame, just assume the reference frame is a identity matrix*. The point of the extra reference frame is just to be able to move the object but if ...
joojaa's user avatar
  • 8,377
4 votes

Ordering a set of unorganized points along a curve

After some clarifications, there is probably a much better approach that doesn't even require knowing the parametric form of the curve, and also avoids the potentially problematic numeric minimisation ...
Martin Ender's user avatar
  • 2,720
4 votes

exact down sampling and re-triangulation of mesh data(non-convex)

1. Method: Vertex Clustering This is more or less a low-quality method, but depending on your mesh it could work well. The basic idea is to partition the space into a regular grid, and then choose ...
Dragonseel's user avatar
  • 1,800
4 votes
Accepted

Extract visible vertices from a 3D geometry model

Idea A: Draw an invisible mesh that will occlude the points we don't want. Create a mesh from the point cloud. Render that mesh to a depth buffer but not to the color buffer. Render the point cloud ...
Julien Guertault's user avatar
4 votes
Accepted

How can I perform a triangle inside test in polygon meshes?

There is an alternative method that relies on flood filling. First arrange your edge data into a loop where the edges are forming a counterclockwise loop. Then start at an arbitrary point on the loop ...
joojaa's user avatar
  • 8,377
4 votes

Best way to remesh a quad 3D mesh?

I'd recommend using OpenVDB. It's quite battle-tested. Use meshToVolume to voxelize the mesh. Then use volumeToMesh to produce ...
Taylor's user avatar
  • 151
4 votes
Accepted

Triangulation of vertices of an ellipsoid

If you sample the two parameters $\eta$ and $\omega$ with steps $d\eta$ and $d\omega$, then you'll get a grid of points $v_{ij} = f(i\;d\eta,j\;d\omega)$. Any four adjacent points will define a ...
gilgamec's user avatar
  • 881

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