Hot answers tagged

22

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 $p_1, p_2$ and normals $n_1, n_2$, then I estimated its curvature as: $$\text{curvature} = \frac{(n_2 - n_1) \cdot (p_2 - p_1)}{|p_2 - p_1|^2}$$ This ...


20

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... Although point E was, mathematically, intended to be exactly on the line segment AB, the pipeline won't be using fully precise values, such as rational ...


18

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 neighbourhood of $v_i$ in your mesh looks like this                    &...


13

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 increasing the detailing of the mesh geometry? Human eyes cant actually see curvature except on the edges of objects. All they can do is approximate the smoothness and ...


13

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 resulting surface. For an example, take a look at these two boxes: The left one is all quads; the right one has the same overall shape, but one corner is made ...


12

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 perpendicular to $u$ and $v$, of length $||u \times v|| = ||u|| \cdot ||v|| sin(\theta)$, with $\theta$ the angle between $u$ and $v$. The direction of the vector ...


9

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 point on a sphere is trivial to compute. Put simply, when you know the derivative of the function, you also know the normal. If your case is narrow enough ...


9

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. But that is of no importance here, we can use that method by adding a rejection clause to it. In this case you simply want certain parts not to be smoothed ...


9

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. More generally, T-junctions in triangle meshes will probably result in discontinuities of interpolated attributes, such as color and normals.


8

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 quads. There are other options to model meshes, one idea would be to use signed distance functions as for example in constructive solid geometry. So back to the ...


7

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 iterating over all the vertices or edges of a given face, in counterclockwise order. In the half-edge structure, this can be done by starting with an arbitrary half-...


6

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 of improving the efficiency without varying from your intended approach, so you can weigh up the alternatives. Blurring the volume instead of the surface If ...


6

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 renderer but at least one is a standard. So you might be looking for something like: RIB, Renderman Bytestream although it comes with as a programming api as well. ...


6

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 would likely be best (assuming you do not need this memory for other purposes in the same kernel). This memory has different names in different APIs, but is the ...


6

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 few links: The Crust Curve Reconstruction Applet Curve Reconstruction by Tamal Dey Curve and Surface Reconstruction: Algorithms with Mathematical Analysis, book ...


5

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's quite fast (something like 1 or 2 ms on a GTX980M, if I remember correctly) Just beware of compiling your shaders in release for the intrinsics to work (due ...


4

I think you are not constructing the index buffer correctly. Firstly you only need 1 degenerate vertex to terminate each triangle-strip row. You also should not need any special handling for odd/even rows. You can emit a single triangle-strip per loop. Your index loop should look something like : var index:Int = 0 for i in 0..<rSimHeight - 1 { for ...


4

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 one representative for each cell that holds at least one vertex. Then calculate the connectivity based on the connectivity of the original vertices. In the image ...


4

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 you have no info about how the object should relate to other objects it does not really matter operator can move it where they want. Everything is relative, if ...


4

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 step. If the curve does not intersect itself and the points are sufficiently densely packed on the curve (and by that I mean they have to be closer than any ...


4

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 the gap between the 2 surfaces. This can be fixed by not having a T-junction in the first place.


4

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 using a depth test "closer or equal". This approach should give the expected result, but the problem with it is the first part, which is not trivial at all. ...


4

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 and pick edges joining that point. Use the outbound boundary edge and cross it with the other outbound edge, if it points in the direction of the face normal ...


4

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 explain why that is the case. Which is useful information and explains why quads are preferred and how to use them. First, observe that a triangle does gets ...


4

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 quadrilateral. To get triangles, you just have to split each quad in two by a diagonal. So in the example, you'd split the quadrilateral $\{v_{00},v_{01},v_{11},v_{...


4

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 maps from different (known) camera positions. you can read more: https://cs.nyu.edu/courses/fall12/CSCI-GA.2945-001/dl/jiakai-slides.pdf file:///C:/Users/...


4

Yes, your understanding it correct. The Laplace-Beltrami depends on the current state $x$ and you have to recompute $L$ if $x$ changes. Therefore you cannot write matix of $\Delta$ without knowing the state $x$. To expand on solving $\frac{\partial x}{\partial t} = -\Delta x$: Discretization in space turns $\Delta$ to $L$, discretization in time turns $\...


3

The simple way to avoid this is to ensure that all your vertices are welded You issue is that you have cuts along edges with a vertex, but you do not have a corresponding vertex on the adjacent edge to weld/connect it to, if you think of it like a button on a shirt, you've sown on a button to the edge, but haven't given it a hole so the fabric is open. In ...


3

Since you've only got floating-point representations of the points, there is no guarantee that these still lie exactly on the curve, due to rounding errors. So I think the only generic approach is to approximate where on the curve they were, by finding the closest point on the curve to your sample $(X,Y,Z)$. E.g. if your parametric curve is $(x(t), y(t), z(t)...


3

Baraff and Witkin propose to incorporate constraints by modifying the linear system by the constraints matrices $\mathbf S_i$. As they state in the beginning of Section 5.2, the resulting system is not symmetric anymore. Therefore, the modified linear system must be computed with a linear solver that can treat non-symmetric systems (as - if I got you ...


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